mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
: Architecture refactoring
This commit is contained in:
parent
2750741170
commit
848ad371ed
349 changed files with 3423 additions and 3479 deletions
|
@ -56,16 +56,20 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':feature_login')
|
||||
implementation project(':feature_editor')
|
||||
implementation project(':feature_desktop')
|
||||
implementation project(':feature_profile')
|
||||
implementation project(':core_utils')
|
||||
|
||||
implementation project(':domain')
|
||||
implementation project(':data')
|
||||
implementation project(':persistence')
|
||||
implementation project(':middleware')
|
||||
implementation project(':presentation')
|
||||
implementation project(':core-utils')
|
||||
|
||||
def applicationDependencies = rootProject.ext.mainApplication
|
||||
def unitTestDependencies = rootProject.ext.unitTesting
|
||||
def acceptanceTesting = rootProject.ext.acceptanceTesting
|
||||
def devDependencies = rootProject.ext.development
|
||||
def databaseDependencies = rootProject.ext.db
|
||||
|
||||
|
||||
//Compile time dependencies
|
||||
kapt applicationDependencies.daggerCompiler
|
||||
|
@ -87,6 +91,11 @@ dependencies {
|
|||
implementation applicationDependencies.gson
|
||||
implementation applicationDependencies.rxRelay
|
||||
|
||||
implementation applicationDependencies.viewModel
|
||||
implementation applicationDependencies.viewModelExtensions
|
||||
|
||||
implementation databaseDependencies.room
|
||||
|
||||
implementation applicationDependencies.crashlytics
|
||||
implementation applicationDependencies.firebaseCore
|
||||
|
||||
|
@ -99,8 +108,6 @@ dependencies {
|
|||
androidTestImplementation acceptanceTesting.espressoCore
|
||||
androidTestImplementation acceptanceTesting.androidJUnit
|
||||
androidTestImplementation acceptanceTesting.testRules
|
||||
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
|
@ -4,6 +4,7 @@ import androidx.navigation.fragment.FragmentNavigator
|
|||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
import com.agileburo.anytype.ui.main.MainActivity
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.runner.RunWith
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
<application
|
||||
android:name=".AndroidApplication"
|
||||
android:name=".app.AndroidApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
|
@ -14,7 +14,8 @@
|
|||
android:supportsRtl="true"
|
||||
android:fullBackupContent="@xml/my_backup_rules"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".MainActivity"
|
||||
<activity
|
||||
android:name=".ui.main.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize">
|
||||
<intent-filter android:label="filter">
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
package com.agileburo.anytype
|
||||
|
||||
import android.app.Application
|
||||
import com.agileburo.anytype.core_utils.di.*
|
||||
import com.agileburo.anytype.core_utils.tools.CrashlyticsTree
|
||||
import com.agileburo.anytype.di.app.AppModule
|
||||
import com.agileburo.anytype.di.app.ApplicationComponent
|
||||
import com.agileburo.anytype.di.app.DaggerApplicationComponent
|
||||
import com.facebook.stetho.Stetho
|
||||
import timber.log.Timber
|
||||
|
||||
class AndroidApplication : Application(), CoreComponentProvider {
|
||||
|
||||
val applicationComponent: ApplicationComponent by lazy {
|
||||
DaggerApplicationComponent.builder()
|
||||
.appModule(AppModule(this))
|
||||
.build()
|
||||
}
|
||||
|
||||
private val coreComponent: CoreComponent by lazy {
|
||||
DaggerCoreComponent
|
||||
.builder()
|
||||
.contextModule(ContextModule(this))
|
||||
.dataModule(DataModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
injectMembers()
|
||||
setupTimber()
|
||||
setupStetho()
|
||||
}
|
||||
|
||||
private fun setupTimber() {
|
||||
if (BuildConfig.DEBUG)
|
||||
Timber.plant(Timber.DebugTree())
|
||||
else
|
||||
Timber.plant(CrashlyticsTree())
|
||||
}
|
||||
|
||||
private fun setupStetho() {
|
||||
if (BuildConfig.DEBUG)
|
||||
Stetho.initializeWithDefaults(this)
|
||||
}
|
||||
|
||||
private fun injectMembers() = applicationComponent.inject(this)
|
||||
|
||||
override fun provideCoreComponent() = coreComponent
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.agileburo.anytype
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.navigation.Navigation
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.NavigationUI
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.core_utils.ext.coreComponent
|
||||
import com.agileburo.anytype.di.app.MainScreenComponent
|
||||
import com.agileburo.anytype.feature_desktop.navigation.DesktopNavigationProvider
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.navigation.AuthNavigation
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.navigation.AuthNavigationProvider
|
||||
import com.agileburo.anytype.feature_profile.navigation.ProfileNavigation
|
||||
import com.agileburo.anytype.feature_profile.navigation.ProfileNavigationProvider
|
||||
import com.agileburo.anytype.navigation.Navigator
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class MainActivity : AppCompatActivity(), AuthNavigationProvider, DesktopNavigationProvider, ProfileNavigationProvider,
|
||||
CoreComponentProvider {
|
||||
|
||||
private val navigator by lazy { Navigator() }
|
||||
|
||||
@Inject
|
||||
lateinit var context: Context
|
||||
|
||||
private val applicationComponent by lazy {
|
||||
(application as AndroidApplication).applicationComponent
|
||||
}
|
||||
|
||||
private val mainScreenComponent: MainScreenComponent by lazy {
|
||||
applicationComponent.mainScreenComponent()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
mainScreenComponent.inject(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
NavigationUI.setupWithNavController(
|
||||
bottomNavigationView,
|
||||
Navigation.findNavController(this, R.id.fragment)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
navigator.bind(findNavController(R.id.fragment))
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
navigator.unbind()
|
||||
}
|
||||
|
||||
override fun provideNavigation(): AuthNavigation = navigator
|
||||
override fun provideDesktopNavigation() = navigator
|
||||
override fun provide(): ProfileNavigation = navigator
|
||||
|
||||
override fun provideCoreComponent() = coreComponent()
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.agileburo.anytype.app
|
||||
|
||||
import android.app.Application
|
||||
import com.agileburo.anytype.BuildConfig
|
||||
import com.agileburo.anytype.core_utils.tools.CrashlyticsTree
|
||||
import com.agileburo.anytype.di.common.ComponentManager
|
||||
import com.agileburo.anytype.di.main.ContextModule
|
||||
import com.agileburo.anytype.di.main.DaggerMainComponent
|
||||
import com.agileburo.anytype.di.main.DataModule
|
||||
import com.agileburo.anytype.di.main.MainComponent
|
||||
import com.facebook.stetho.Stetho
|
||||
import timber.log.Timber
|
||||
|
||||
class AndroidApplication : Application() {
|
||||
|
||||
private val main: MainComponent by lazy {
|
||||
DaggerMainComponent
|
||||
.builder()
|
||||
.contextModule(ContextModule(this))
|
||||
.dataModule(DataModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val componentManager by lazy {
|
||||
ComponentManager(main)
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
setupTimber()
|
||||
setupStetho()
|
||||
}
|
||||
|
||||
private fun setupTimber() {
|
||||
if (BuildConfig.DEBUG)
|
||||
Timber.plant(Timber.DebugTree())
|
||||
else
|
||||
Timber.plant(CrashlyticsTree())
|
||||
}
|
||||
|
||||
private fun setupStetho() {
|
||||
if (BuildConfig.DEBUG)
|
||||
Stetho.initializeWithDefaults(this)
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.device
|
||||
package com.agileburo.anytype.device
|
||||
|
||||
import android.content.Context
|
||||
import com.agileburo.anytype.feature_login.ui.login.domain.common.PathProvider
|
||||
import com.agileburo.anytype.domain.auth.repo.PathProvider
|
||||
|
||||
class DefaultPathProvider(
|
||||
private val context: Context
|
|
@ -1,15 +0,0 @@
|
|||
package com.agileburo.anytype.di.app
|
||||
|
||||
import android.content.Context
|
||||
import com.agileburo.anytype.AndroidApplication
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
class AppModule(private val app: AndroidApplication) {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideContext(): Context = app.applicationContext
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.agileburo.anytype.di.app
|
||||
|
||||
import android.content.Context
|
||||
import com.agileburo.anytype.AndroidApplication
|
||||
import com.agileburo.anytype.core_utils.ext.BaseSchedulerProvider
|
||||
import com.agileburo.anytype.feature_editor.EditorComponent
|
||||
import dagger.Component
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Component(modules = [AppModule::class, RxJavaModule::class])
|
||||
interface ApplicationComponent {
|
||||
|
||||
fun inject(app: AndroidApplication)
|
||||
fun mainScreenComponent(): MainScreenComponent
|
||||
fun editorComponent(): EditorComponent
|
||||
|
||||
fun context(): Context
|
||||
fun schedulerProvider(): BaseSchedulerProvider
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.agileburo.anytype.di.app
|
||||
|
||||
import com.agileburo.anytype.MainActivity
|
||||
import com.agileburo.anytype.core_utils.di.scope.PerScreen
|
||||
import dagger.Subcomponent
|
||||
|
||||
@PerScreen
|
||||
@Subcomponent(modules = [MainScreenModule::class])
|
||||
interface MainScreenComponent{
|
||||
|
||||
fun inject(mainScreen: MainActivity)
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.agileburo.anytype.di.app
|
||||
|
||||
import dagger.Module
|
||||
|
||||
@Module
|
||||
class MainScreenModule{
|
||||
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.agileburo.anytype.di.app
|
||||
|
||||
import com.agileburo.anytype.core_utils.ext.BaseSchedulerProvider
|
||||
import com.agileburo.anytype.core_utils.ext.SchedulerProvider
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 02.04.2019.
|
||||
*/
|
||||
@Module
|
||||
class RxJavaModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideSchedulerProvider(): BaseSchedulerProvider =
|
||||
SchedulerProvider()
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.agileburo.anytype.di.common
|
||||
|
||||
import com.agileburo.anytype.di.feature.*
|
||||
import com.agileburo.anytype.di.main.MainComponent
|
||||
|
||||
class ComponentManager(private val main: MainComponent) {
|
||||
|
||||
private val authComponent = Component {
|
||||
main.authComponentBuilder().authModule(AuthModule()).build()
|
||||
}
|
||||
|
||||
val startLoginComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.startLoginComponentBuilder()
|
||||
.startLoginModule(StartLoginModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val createAccountComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.createAccountComponentBuilder()
|
||||
.createAccountModule(CreateAccountModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val setupNewAccountComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.setupNewAccountComponentBuilder()
|
||||
.setupNewAccountModule(SetupNewAccountModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val setupSelectedAccountComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.setupSelectedAccountComponentBuilder()
|
||||
.setupSelectedAccountModule(SetupSelectedAccountModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val selectAccountComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.selectAccountComponentBuilder()
|
||||
.selectAccountModule(SelectAccountModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val keychainLoginComponent = Component {
|
||||
authComponent
|
||||
.get()
|
||||
.keychainLoginComponentBuilder()
|
||||
.keychainLoginModule(KeychainLoginModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val profileComponent = Component {
|
||||
main
|
||||
.profileComponentBuilder()
|
||||
.profileModule(ProfileModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
class Component<T>(private val builder: () -> T) {
|
||||
|
||||
private var instance: T? = null
|
||||
|
||||
fun get() = instance ?: builder().also { instance = it }
|
||||
|
||||
fun new() = builder().also { instance = it }
|
||||
|
||||
fun release() {
|
||||
instance = null
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.agileburo.anytype.di.common
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.agileburo.anytype.app.AndroidApplication
|
||||
|
||||
fun Fragment.componentManager(): ComponentManager {
|
||||
return (requireActivity().applicationContext as AndroidApplication).componentManager
|
||||
}
|
293
app/src/main/java/com/agileburo/anytype/di/feature/AuthDI.kt
Normal file
293
app/src/main/java/com/agileburo/anytype/di/feature/AuthDI.kt
Normal file
|
@ -0,0 +1,293 @@
|
|||
package com.agileburo.anytype.di.feature
|
||||
|
||||
import com.agileburo.anytype.core_utils.di.scope.PerFeature
|
||||
import com.agileburo.anytype.core_utils.di.scope.PerScreen
|
||||
import com.agileburo.anytype.domain.auth.interactor.*
|
||||
import com.agileburo.anytype.domain.auth.repo.AuthRepository
|
||||
import com.agileburo.anytype.domain.auth.repo.PathProvider
|
||||
import com.agileburo.anytype.presentation.auth.account.CreateAccountViewModelFactory
|
||||
import com.agileburo.anytype.presentation.auth.account.SelectAccountViewModelFactory
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupNewAccountViewModelFactory
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupSelectedAccountViewModelFactory
|
||||
import com.agileburo.anytype.presentation.auth.keychain.KeychainLoginViewModelFactory
|
||||
import com.agileburo.anytype.presentation.auth.model.Session
|
||||
import com.agileburo.anytype.presentation.auth.start.StartLoginViewModelFactory
|
||||
import com.agileburo.anytype.ui.auth.KeychainLoginFragment
|
||||
import com.agileburo.anytype.ui.auth.StartLoginFragment
|
||||
import com.agileburo.anytype.ui.auth.account.CreateAccountFragment
|
||||
import com.agileburo.anytype.ui.auth.account.SelectAccountFragment
|
||||
import com.agileburo.anytype.ui.auth.account.SetupNewAccountFragment
|
||||
import com.agileburo.anytype.ui.auth.account.SetupSelectedAccountFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [AuthModule::class])
|
||||
@PerFeature
|
||||
interface AuthSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun authModule(module: AuthModule): Builder
|
||||
fun build(): AuthSubComponent
|
||||
}
|
||||
|
||||
fun startLoginComponentBuilder(): StartLoginSubComponent.Builder
|
||||
fun createAccountComponentBuilder(): CreateAccountSubComponent.Builder
|
||||
fun setupNewAccountComponentBuilder(): SetupNewAccountSubComponent.Builder
|
||||
fun setupSelectedAccountComponentBuilder(): SetupSelectedAccountSubComponent.Builder
|
||||
fun selectAccountComponentBuilder(): SelectAccountSubComponent.Builder
|
||||
fun keychainLoginComponentBuilder(): KeychainLoginSubComponent.Builder
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [StartLoginModule::class])
|
||||
@PerScreen
|
||||
interface StartLoginSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun startLoginModule(module: StartLoginModule): Builder
|
||||
fun build(): StartLoginSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: StartLoginFragment)
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [CreateAccountModule::class])
|
||||
@PerScreen
|
||||
interface CreateAccountSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun createAccountModule(module: CreateAccountModule): Builder
|
||||
fun build(): CreateAccountSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: CreateAccountFragment)
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [SetupNewAccountModule::class])
|
||||
@PerScreen
|
||||
interface SetupNewAccountSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun setupNewAccountModule(module: SetupNewAccountModule): Builder
|
||||
fun build(): SetupNewAccountSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: SetupNewAccountFragment)
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [SetupSelectedAccountModule::class])
|
||||
@PerScreen
|
||||
interface SetupSelectedAccountSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun setupSelectedAccountModule(module: SetupSelectedAccountModule): Builder
|
||||
fun build(): SetupSelectedAccountSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: SetupSelectedAccountFragment)
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [SelectAccountModule::class])
|
||||
@PerScreen
|
||||
interface SelectAccountSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun selectAccountModule(module: SelectAccountModule): Builder
|
||||
fun build(): SelectAccountSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: SelectAccountFragment)
|
||||
}
|
||||
|
||||
@Subcomponent(modules = [KeychainLoginModule::class])
|
||||
@PerScreen
|
||||
interface KeychainLoginSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun keychainLoginModule(module: KeychainLoginModule): Builder
|
||||
fun build(): KeychainLoginSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: KeychainLoginFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class AuthModule {
|
||||
|
||||
@PerFeature
|
||||
@Provides
|
||||
fun provideSession(): Session {
|
||||
return Session()
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class StartLoginModule {
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideStartLoginViewModelFactory(
|
||||
setupWallet: SetupWallet,
|
||||
pathProvider: PathProvider
|
||||
): StartLoginViewModelFactory {
|
||||
return StartLoginViewModelFactory(
|
||||
setupWallet = setupWallet,
|
||||
pathProvider = pathProvider
|
||||
)
|
||||
}
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideSetupWalletUseCase(
|
||||
authRepository: AuthRepository
|
||||
): SetupWallet {
|
||||
return SetupWallet(
|
||||
repository = authRepository
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class CreateAccountModule {
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideCreateAccountViewModelFactory(
|
||||
session: Session
|
||||
): CreateAccountViewModelFactory {
|
||||
return CreateAccountViewModelFactory(
|
||||
session = session
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class SetupNewAccountModule {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideSetupAccountViewModelFactory(
|
||||
createAccount: CreateAccount,
|
||||
session: Session
|
||||
): SetupNewAccountViewModelFactory {
|
||||
return SetupNewAccountViewModelFactory(
|
||||
createAccount = createAccount,
|
||||
session = session
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideCreateAccountUseCase(
|
||||
repository: AuthRepository
|
||||
): CreateAccount {
|
||||
return CreateAccount(
|
||||
repository = repository
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class SetupSelectedAccountModule {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideSetupSelectedAccountViewModelFactory(
|
||||
selectAccount: SelectAccount,
|
||||
pathProvider: PathProvider
|
||||
): SetupSelectedAccountViewModelFactory {
|
||||
return SetupSelectedAccountViewModelFactory(
|
||||
selectAccount = selectAccount,
|
||||
pathProvider = pathProvider
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideSelectAccountUseCase(
|
||||
repository: AuthRepository
|
||||
): SelectAccount {
|
||||
return SelectAccount(
|
||||
repository = repository
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class SelectAccountModule {
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideSelectAccountViewModelFactory(
|
||||
startLoadingAccounts: StartLoadingAccounts,
|
||||
observeAccounts: ObserveAccounts
|
||||
): SelectAccountViewModelFactory {
|
||||
return SelectAccountViewModelFactory(
|
||||
startLoadingAccounts = startLoadingAccounts,
|
||||
observeAccounts = observeAccounts
|
||||
)
|
||||
}
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideRecoverAccountUseCase(repository: AuthRepository): StartLoadingAccounts {
|
||||
return StartLoadingAccounts(
|
||||
repository = repository
|
||||
)
|
||||
}
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideObserveAccountsUseCase(
|
||||
repository: AuthRepository
|
||||
): ObserveAccounts {
|
||||
return ObserveAccounts(
|
||||
repository = repository
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Module
|
||||
class KeychainLoginModule {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideKeychainLoginViewModelFactory(
|
||||
pathProvider: PathProvider,
|
||||
recoverWallet: RecoverWallet,
|
||||
saveMnemonic: SaveMnemonic
|
||||
): KeychainLoginViewModelFactory {
|
||||
return KeychainLoginViewModelFactory(
|
||||
pathProvider = pathProvider,
|
||||
recoverWallet = recoverWallet,
|
||||
saveMnemonic = saveMnemonic
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideRecoverWalletUseCase(
|
||||
authRepository: AuthRepository
|
||||
): RecoverWallet {
|
||||
return RecoverWallet(
|
||||
repository = authRepository
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideSaveMnemonicUseCase(
|
||||
authRepository: AuthRepository
|
||||
): SaveMnemonic {
|
||||
return SaveMnemonic(
|
||||
repository = authRepository
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.agileburo.anytype.di.feature
|
||||
|
||||
import com.agileburo.anytype.core_utils.di.scope.PerScreen
|
||||
import com.agileburo.anytype.domain.auth.interactor.Logout
|
||||
import com.agileburo.anytype.domain.auth.repo.AuthRepository
|
||||
import com.agileburo.anytype.presentation.profile.ProfileViewModelFactory
|
||||
import com.agileburo.anytype.ui.profile.ProfileFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
|
||||
@Subcomponent(
|
||||
modules = [ProfileModule::class]
|
||||
)
|
||||
@PerScreen
|
||||
interface ProfileSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun profileModule(module: ProfileModule): Builder
|
||||
fun build(): ProfileSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: ProfileFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class ProfileModule {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideProfileViewModelFactory(
|
||||
logout: Logout
|
||||
): ProfileViewModelFactory {
|
||||
return ProfileViewModelFactory(
|
||||
logout = logout
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideLogoutUseCase(repository: AuthRepository): Logout {
|
||||
return Logout(repository)
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.agileburo.anytype.core_utils.di
|
||||
package com.agileburo.anytype.di.main
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
|
@ -7,7 +7,7 @@ import dagger.Provides
|
|||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
class ContextModule(val application: Application) {
|
||||
class ContextModule(private val application: Application) {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
116
app/src/main/java/com/agileburo/anytype/di/main/DataModule.kt
Normal file
116
app/src/main/java/com/agileburo/anytype/di/main/DataModule.kt
Normal file
|
@ -0,0 +1,116 @@
|
|||
package com.agileburo.anytype.di.main
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import com.agileburo.anytype.data.auth.repo.*
|
||||
import com.agileburo.anytype.db.AnytypeDatabase
|
||||
import com.agileburo.anytype.device.DefaultPathProvider
|
||||
import com.agileburo.anytype.domain.auth.repo.AuthRepository
|
||||
import com.agileburo.anytype.domain.auth.repo.PathProvider
|
||||
import com.agileburo.anytype.middleware.EventProxy
|
||||
import com.agileburo.anytype.middleware.auth.AuthMiddleware
|
||||
import com.agileburo.anytype.middleware.interactor.Handler
|
||||
import com.agileburo.anytype.middleware.interactor.Middleware
|
||||
import com.agileburo.anytype.repo.DefaultAuthCache
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
class DataModule {
|
||||
|
||||
@Provides
|
||||
fun providePathProvider(context: Context): PathProvider {
|
||||
return DefaultPathProvider(context)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthRepository(
|
||||
factory: AuthDataStoreFactory
|
||||
): AuthRepository {
|
||||
return AuthDataRepository(
|
||||
factory = factory
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthDataStoreFactory(
|
||||
authCacheDataStore: AuthCacheDataStore,
|
||||
authRemoteDataStore: AuthRemoteDataStore
|
||||
): AuthDataStoreFactory {
|
||||
return AuthDataStoreFactory(
|
||||
cache = authCacheDataStore,
|
||||
remote = authRemoteDataStore
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthCacheDataStore(
|
||||
authCache: AuthCache
|
||||
): AuthCacheDataStore {
|
||||
return AuthCacheDataStore(
|
||||
cache = authCache
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthCache(
|
||||
db: AnytypeDatabase,
|
||||
prefs: SharedPreferences
|
||||
): AuthCache {
|
||||
return DefaultAuthCache(
|
||||
db = db,
|
||||
prefs = prefs
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAnytypeDatabase(context: Context): AnytypeDatabase {
|
||||
return AnytypeDatabase.get(context)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideSharedPreferences(context: Context): SharedPreferences {
|
||||
return context.getSharedPreferences("prefs", Context.MODE_PRIVATE)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthRemoteDataStore(
|
||||
authRemote: AuthRemote
|
||||
): AuthRemoteDataStore {
|
||||
return AuthRemoteDataStore(
|
||||
authRemote = authRemote
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthRemote(
|
||||
middleware: Middleware,
|
||||
proxy: EventProxy
|
||||
): AuthRemote {
|
||||
return AuthMiddleware(
|
||||
middleware = middleware,
|
||||
events = proxy
|
||||
)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideEventProxy(): EventProxy {
|
||||
return Handler()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMiddleware(): Middleware {
|
||||
return Middleware()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.agileburo.anytype.di.main
|
||||
|
||||
import com.agileburo.anytype.di.feature.AuthSubComponent
|
||||
import com.agileburo.anytype.di.feature.ProfileSubComponent
|
||||
import dagger.Component
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Component(
|
||||
modules = [
|
||||
ContextModule::class,
|
||||
DataModule::class
|
||||
]
|
||||
)
|
||||
interface MainComponent {
|
||||
fun authComponentBuilder(): AuthSubComponent.Builder
|
||||
fun profileComponentBuilder(): ProfileSubComponent.Builder
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.agileburo.anytype.feature_profile.presentation.ui
|
||||
|
||||
import com.agileburo.anytype.AndroidApplication
|
||||
import com.agileburo.anytype.feature_editor.ui.EditorFragment
|
||||
|
||||
class DocumentFragment : EditorFragment() {
|
||||
|
||||
private val appComponent by lazy {
|
||||
(requireActivity().application as AndroidApplication).applicationComponent
|
||||
}
|
||||
|
||||
private val editorComponent by lazy {
|
||||
appComponent.editorComponent()
|
||||
}
|
||||
|
||||
override fun inject() {
|
||||
editorComponent.inject(this)
|
||||
}
|
||||
}
|
|
@ -3,16 +3,17 @@ package com.agileburo.anytype.navigation
|
|||
import android.os.Bundle
|
||||
import androidx.navigation.NavController
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.feature_desktop.navigation.DesktopNavigation
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.common.Keys
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.navigation.AuthNavigation
|
||||
import com.agileburo.anytype.feature_profile.navigation.ProfileNavigation
|
||||
import timber.log.Timber
|
||||
import com.agileburo.anytype.presentation.navigation.AppNavigation
|
||||
import com.agileburo.anytype.ui.auth.Keys
|
||||
|
||||
class Navigator : AuthNavigation, DesktopNavigation, ProfileNavigation {
|
||||
class Navigator : AppNavigation {
|
||||
|
||||
private var navController: NavController? = null
|
||||
|
||||
override fun startLogin() {
|
||||
navController?.navigate(R.id.action_open_start_login)
|
||||
}
|
||||
|
||||
override fun createProfile() {
|
||||
navController?.navigate(R.id.action_open_sign_up)
|
||||
}
|
||||
|
@ -37,8 +38,12 @@ class Navigator : AuthNavigation, DesktopNavigation, ProfileNavigation {
|
|||
navController?.navigate(R.id.action_open_desktop_screen)
|
||||
}
|
||||
|
||||
override fun openProfile() {
|
||||
navController?.navigate(R.id.action_open_profile)
|
||||
}
|
||||
|
||||
override fun openDocument(id: String) {
|
||||
navController?.navigate(R.id.action_open_document)
|
||||
// TODO
|
||||
}
|
||||
|
||||
override fun setupSelectedAccount(id: String) {
|
||||
|
@ -52,23 +57,13 @@ class Navigator : AuthNavigation, DesktopNavigation, ProfileNavigation {
|
|||
navController?.navigate(R.id.choosePinCodeScreen)
|
||||
}
|
||||
|
||||
override fun openProfile() {
|
||||
navController?.navigate(R.id.action_open_profile)
|
||||
}
|
||||
|
||||
override fun confirmPinCode(pin: String) {
|
||||
/*
|
||||
navController?.navigate(
|
||||
R.id.confirmPinCodeScreen,
|
||||
Bundle().apply { putString(Keys.PIN_CODE_KEY, pin) }
|
||||
)
|
||||
}
|
||||
|
||||
override fun openPinCodeScreen() {
|
||||
Timber.d("OpenPinCodeScreen called")
|
||||
}
|
||||
|
||||
override fun openKeychainScreen() {
|
||||
Timber.d("OpenKeychainScreen called")
|
||||
*/
|
||||
}
|
||||
|
||||
fun bind(navController: NavController) {
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.agileburo.anytype.ui.auth
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.presentation.auth.congratulation.CongratulationViewModel
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_congratulation.*
|
||||
|
||||
class CongratulationFragment : NavigationFragment(R.layout.fragment_congratulation) {
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this)
|
||||
.get(CongratulationViewModel::class.java)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
startButton.setOnClickListener { vm.onStartClicked() }
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {}
|
||||
|
||||
override fun releaseDependencies() {}
|
||||
}
|
|
@ -1,26 +1,22 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.keychain
|
||||
package com.agileburo.anytype.ui.auth
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.core_utils.ext.disposedBy
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ext.hideKeyboard
|
||||
import com.agileburo.anytype.core_utils.ext.toast
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.di.KeychainLoginSubComponent
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.congratulation.ViewState
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.keychain.KeychainLoginViewModel
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.keychain.KeychainLoginViewModelFactory
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.BaseFragment
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.utils.DoneActionListener
|
||||
import com.agileburo.anytype.core_utils.ui.DoneActionListener
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.congratulation.ViewState
|
||||
import com.agileburo.anytype.presentation.auth.keychain.KeychainLoginViewModel
|
||||
import com.agileburo.anytype.presentation.auth.keychain.KeychainLoginViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_keychain_login.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class KeychainLoginFragment : BaseFragment() {
|
||||
class KeychainLoginFragment : NavigationFragment(R.layout.fragment_keychain_login) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: KeychainLoginViewModelFactory
|
||||
|
@ -31,12 +27,6 @@ class KeychainLoginFragment : BaseFragment() {
|
|||
.get(KeychainLoginViewModel::class.java)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.fragment_keychain_login, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupButtons()
|
||||
|
@ -81,7 +71,7 @@ class KeychainLoginFragment : BaseFragment() {
|
|||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
private fun setupButtons() {
|
||||
|
@ -94,14 +84,10 @@ class KeychainLoginFragment : BaseFragment() {
|
|||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
(activity as? CoreComponentProvider)?.let { provider ->
|
||||
KeychainLoginSubComponent
|
||||
.get(provider.provideCoreComponent())
|
||||
.inject(this)
|
||||
}
|
||||
componentManager().keychainLoginComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
KeychainLoginSubComponent.clear()
|
||||
componentManager().keychainLoginComponent.release()
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.common
|
||||
package com.agileburo.anytype.ui.auth
|
||||
|
||||
object Keys {
|
||||
const val PIN_CODE_KEY = "code"
|
|
@ -0,0 +1,51 @@
|
|||
package com.agileburo.anytype.ui.auth
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.start.StartLoginViewModel
|
||||
import com.agileburo.anytype.presentation.auth.start.StartLoginViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_start_login.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class StartLoginFragment : NavigationFragment(R.layout.fragment_start_login) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: StartLoginViewModelFactory
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this, factory)
|
||||
.get(StartLoginViewModel::class.java)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupButtonClicks()
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
private fun setupButtonClicks() {
|
||||
signUpButton.setOnClickListener { vm.onSignUpClicked() }
|
||||
loginButton.setOnClickListener { vm.onLoginClicked() }
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().startLoginComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().startLoginComponent.release()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.agileburo.anytype.ui.auth.account
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ext.hideKeyboard
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.account.CreateAccountViewModel
|
||||
import com.agileburo.anytype.presentation.auth.account.CreateAccountViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_create_account.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class CreateAccountFragment : NavigationFragment(R.layout.fragment_create_account) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: CreateAccountViewModelFactory
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this, factory)
|
||||
.get(CreateAccountViewModel::class.java)
|
||||
}
|
||||
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
createProfileButton.setOnClickListener {
|
||||
vm.onCreateProfileClicked(nameInputField.text.toString())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
hideKeyboard(activity?.currentFocus)
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().createAccountComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().createAccountComponent.release()
|
||||
}
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.profile
|
||||
package com.agileburo.anytype.ui.auth.account
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.profile.ChooseProfileView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.presentation.auth.model.ChooseProfileView
|
||||
import com.agileburo.anytype.presentation.auth.model.ChooseProfileView.Companion.ADD_NEW_PROFILE
|
||||
import com.agileburo.anytype.presentation.auth.model.ChooseProfileView.Companion.PROFILE
|
||||
import kotlinx.android.synthetic.main.item_choose_profile_profile.view.*
|
||||
|
||||
class SelectAccountAdapter(
|
||||
|
@ -86,9 +88,4 @@ class SelectAccountAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val PROFILE = 0
|
||||
const val ADD_NEW_PROFILE = 1
|
||||
}
|
||||
|
||||
}
|
|
@ -1,25 +1,21 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.profile
|
||||
package com.agileburo.anytype.ui.auth.account
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ext.dimen
|
||||
import com.agileburo.anytype.core_utils.ext.disposedBy
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.di.SelectProfileSubComponent
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.profile.SelectAccountViewModel
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.profile.SelectAccountViewModelFactory
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.BaseFragment
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.SpacingItemDecoration
|
||||
import kotlinx.android.synthetic.main.fragment_choose_profile.*
|
||||
import com.agileburo.anytype.core_utils.ui.SpacingItemDecoration
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.account.SelectAccountViewModel
|
||||
import com.agileburo.anytype.presentation.auth.account.SelectAccountViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_select_account.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SelectAccountFragment : BaseFragment() {
|
||||
class SelectAccountFragment : NavigationFragment(R.layout.fragment_select_account) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: SelectAccountViewModelFactory
|
||||
|
@ -38,12 +34,6 @@ class SelectAccountFragment : BaseFragment() {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.fragment_choose_profile, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
logoutButton.setOnClickListener { vm.onLogoutClicked() }
|
||||
|
@ -66,18 +56,14 @@ class SelectAccountFragment : BaseFragment() {
|
|||
profileAdapter.update(state)
|
||||
})
|
||||
|
||||
vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
(activity as? CoreComponentProvider)?.let { provider ->
|
||||
SelectProfileSubComponent
|
||||
.get(provider.provideCoreComponent())
|
||||
.inject(this)
|
||||
}
|
||||
componentManager().selectAccountComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
SelectProfileSubComponent.clear()
|
||||
componentManager().selectAccountComponent.release()
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.setup
|
||||
package com.agileburo.anytype.ui.auth.account
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
|
@ -6,17 +6,15 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.view.animation.AnimationUtils
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.core_utils.ext.disposedBy
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.di.SetupNewAccountSubComponent
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.setup.SetupNewAccountViewModel
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.setup.SetupNewAccountViewModelFactory
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.BaseFragment
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupNewAccountViewModel
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupNewAccountViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_setup_new_account.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SetupNewAccountFragment : BaseFragment() {
|
||||
class SetupNewAccountFragment : NavigationFragment(R.layout.fragment_setup_new_account) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: SetupNewAccountViewModelFactory
|
||||
|
@ -44,18 +42,14 @@ class SetupNewAccountFragment : BaseFragment() {
|
|||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
(activity as? CoreComponentProvider)?.let { provider ->
|
||||
SetupNewAccountSubComponent
|
||||
.get(provider.provideCoreComponent())
|
||||
.inject(this)
|
||||
}
|
||||
componentManager().setupNewAccountComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
SetupNewAccountSubComponent.clear()
|
||||
componentManager().setupNewAccountComponent.release()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.agileburo.anytype.ui.auth.account
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.animation.AnimationUtils
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupSelectedAccountViewModel
|
||||
import com.agileburo.anytype.presentation.auth.account.SetupSelectedAccountViewModelFactory
|
||||
import com.agileburo.anytype.ui.auth.Keys
|
||||
import com.agileburo.anytype.ui.base.NavigationFragment
|
||||
import kotlinx.android.synthetic.main.fragment_setup_new_account.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SetupSelectedAccountFragment : NavigationFragment(R.layout.fragment_setup_selected_account) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: SetupSelectedAccountViewModelFactory
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this, factory)
|
||||
.get(SetupSelectedAccountViewModel::class.java)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
vm.selectAccount(arguments?.getString(Keys.SELECTED_ACCOUNT_ID_KEY) ?: throw IllegalStateException())
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
icon.startAnimation(AnimationUtils.loadAnimation(requireContext(), R.anim.rotation))
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().observe(this, navObserver)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().setupSelectedAccountComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().setupSelectedAccountComponent.release()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.presentation.auth.pin.ChoosePinCodeViewModel
|
||||
import com.agileburo.anytype.presentation.auth.pin.ChoosePinCodeViewModelFactory
|
||||
import kotlinx.android.synthetic.main.fragment_choose_pin_code.*
|
||||
|
||||
class ChoosePinCodeFragment : PinCodeFragment(R.layout.fragment_choose_pin_code) {
|
||||
|
||||
//@Inject
|
||||
lateinit var factory: ChoosePinCodeViewModelFactory
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this)
|
||||
.get(ChoosePinCodeViewModel::class.java)
|
||||
}
|
||||
|
||||
private val numPadAdapter by lazy {
|
||||
NumPadAdapter(
|
||||
onNumberClicked = { view ->
|
||||
//vm.onNumPadClicked(view.number)
|
||||
},
|
||||
onRemoveClicked = {
|
||||
//vm.onRemovedDigitClicked()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupRecyclers()
|
||||
doItLaterButton.setOnClickListener {
|
||||
//vm.onDoItLaterClicked()
|
||||
}
|
||||
}
|
||||
|
||||
override fun provideDotRecycler(): RecyclerView = dotRecycler
|
||||
override fun provideNumPadRecycler(): RecyclerView = numPadRecycler
|
||||
override fun provideNumPadAdapter(): NumPadAdapter = numPadAdapter
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
//vm.pin.subscribe { state -> updateDotAdapter(state) }.disposedBy(subscriptions)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
//vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
|
||||
}
|
||||
}
|
|
@ -6,17 +6,15 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.core_utils.ext.disposedBy
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.di.ConfirmPinCodeSubComponent
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.common.Keys
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.ConfirmPinCodeViewModel
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.ConfirmPinCodeViewModelFactory
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.presentation.auth.pin.ConfirmPinCodeViewModel
|
||||
import com.agileburo.anytype.presentation.auth.pin.ConfirmPinCodeViewModelFactory
|
||||
import com.agileburo.anytype.ui.auth.pin.NumPadAdapter
|
||||
import com.agileburo.anytype.ui.auth.pin.PinCodeFragment
|
||||
import kotlinx.android.synthetic.main.fragment_confirm_pin_code.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ConfirmPinCodeFragment : PinCodeFragment() {
|
||||
class ConfirmPinCodeFragment : PinCodeFragment(R.layout.fragment_confirm_pin_code) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: ConfirmPinCodeViewModelFactory
|
||||
|
@ -29,8 +27,12 @@ class ConfirmPinCodeFragment : PinCodeFragment() {
|
|||
|
||||
private val numPadAdapter by lazy {
|
||||
NumPadAdapter(
|
||||
onNumberClicked = { view -> vm.onNumPadClicked(view.number) },
|
||||
onRemoveClicked = { vm.onRemovedDigitClicked() }
|
||||
onNumberClicked = {
|
||||
//view -> vm.onNumPadClicked(view.number)
|
||||
},
|
||||
onRemoveClicked = {
|
||||
//vm.onRemovedDigitClicked()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -44,35 +46,26 @@ class ConfirmPinCodeFragment : PinCodeFragment() {
|
|||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.fragment_confirm_pin_code, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupRecyclers()
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
setupPinCode()
|
||||
vm.pin.subscribe { state -> updateDotAdapter(state) }.disposedBy(subscriptions)
|
||||
//vm.pin.subscribe { state -> updateDotAdapter(state) }.disposedBy(subscriptions)
|
||||
setupNavigation()
|
||||
}
|
||||
|
||||
private fun setupPinCode() {
|
||||
vm.code = arguments?.getString(Keys.PIN_CODE_KEY) ?: throw IllegalStateException("Code can't be null")
|
||||
//vm.code = arguments?.getString(Keys.PIN_CODE_KEY) ?: throw IllegalStateException("Code can't be null")
|
||||
}
|
||||
|
||||
private fun setupNavigation() {
|
||||
vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
//vm.observeNavigation().subscribe { navigation(it) }.disposedBy(subscriptions)
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
(activity as? CoreComponentProvider)?.let { provider ->
|
||||
ConfirmPinCodeSubComponent
|
||||
.get(provider.provideCoreComponent())
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
ConfirmPinCodeSubComponent.clear()
|
||||
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.pin
|
||||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.R
|
||||
import kotlinx.android.synthetic.main.item_dot.view.*
|
||||
|
||||
class DotAdapter(
|
|
@ -0,0 +1,5 @@
|
|||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
data class DotView(
|
||||
val active: Boolean
|
||||
)
|
|
@ -1,27 +1,21 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.pin
|
||||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.agileburo.anytype.core_utils.di.CoreComponentProvider
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ext.dimen
|
||||
import com.agileburo.anytype.core_utils.ext.disposedBy
|
||||
import com.agileburo.anytype.core_utils.ext.setOnClickListeners
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.di.EnterPinCodeSubComponent
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.EnterPinCodeViewModel
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.EnterPinCodeViewModelFactory
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.BaseFragment
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.SpacingItemDecoration
|
||||
import kotlinx.android.synthetic.main.fragment_choose_pin_code.dotRecycler
|
||||
import com.agileburo.anytype.core_utils.ui.BaseFragment
|
||||
import com.agileburo.anytype.core_utils.ui.SpacingItemDecoration
|
||||
import com.agileburo.anytype.presentation.auth.pin.EnterPinCodeViewModel
|
||||
import com.agileburo.anytype.presentation.auth.pin.EnterPinCodeViewModelFactory
|
||||
import kotlinx.android.synthetic.main.fragment_enter_pin_code.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class EnterPinCodeFragment : BaseFragment() {
|
||||
class EnterPinCodeFragment : BaseFragment(R.layout.fragment_enter_pin_code) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: EnterPinCodeViewModelFactory
|
||||
|
@ -80,43 +74,15 @@ class EnterPinCodeFragment : BaseFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
|
||||
vm.pin.subscribe { state ->
|
||||
val update = dotAdapter.dots.mapIndexed { index, dot ->
|
||||
if (index < state.digits.size)
|
||||
dot.copy(active = true)
|
||||
else
|
||||
dot.copy(active = false)
|
||||
}
|
||||
|
||||
dotAdapter.dots.apply {
|
||||
clear()
|
||||
addAll(update)
|
||||
}
|
||||
|
||||
dotAdapter.notifyDataSetChanged()
|
||||
|
||||
}.disposedBy(subscriptions)
|
||||
}
|
||||
|
||||
private fun setupNumPad() {
|
||||
pad.setOnClickListeners(View.OnClickListener { view ->
|
||||
vm.onNumPadClicked((view as TextView).text.toString())
|
||||
})
|
||||
removeButton.setOnClickListener { vm.onRemovedDigitClicked() }
|
||||
//
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
(activity as? CoreComponentProvider)?.let { provider ->
|
||||
EnterPinCodeSubComponent
|
||||
.get(provider.provideCoreComponent())
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
EnterPinCodeSubComponent.clear()
|
||||
|
||||
}
|
||||
}
|
|
@ -1,11 +1,14 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.pin
|
||||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.NumPadView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.presentation.auth.pin.NumPadView
|
||||
import com.agileburo.anytype.presentation.auth.pin.NumPadView.Companion.EMPTY
|
||||
import com.agileburo.anytype.presentation.auth.pin.NumPadView.Companion.NUMBER
|
||||
import com.agileburo.anytype.presentation.auth.pin.NumPadView.Companion.REMOVE
|
||||
import kotlinx.android.synthetic.main.item_num_pad_number.view.*
|
||||
import kotlinx.android.synthetic.main.item_num_pad_remove.view.*
|
||||
|
||||
|
@ -81,9 +84,6 @@ class NumPadAdapter(
|
|||
}
|
||||
|
||||
companion object {
|
||||
const val NUMBER = 0
|
||||
const val REMOVE = 1
|
||||
const val EMPTY = 2
|
||||
|
||||
fun initialData(): List<NumPadView> {
|
||||
return listOf(
|
|
@ -1,14 +1,17 @@
|
|||
package com.agileburo.anytype.feature_login.ui.login.presentation.ui.pin
|
||||
package com.agileburo.anytype.ui.auth.pin
|
||||
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ext.dimen
|
||||
import com.agileburo.anytype.feature_login.R
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.mvvm.pin.PinCodeState
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.BaseFragment
|
||||
import com.agileburo.anytype.feature_login.ui.login.presentation.ui.common.SpacingItemDecoration
|
||||
import com.agileburo.anytype.core_utils.ui.BaseFragment
|
||||
import com.agileburo.anytype.core_utils.ui.SpacingItemDecoration
|
||||
import com.agileburo.anytype.presentation.auth.pin.PinCodeState
|
||||
|
||||
abstract class PinCodeFragment : BaseFragment() {
|
||||
abstract class PinCodeFragment(
|
||||
@LayoutRes private val layout: Int
|
||||
) : BaseFragment(layout) {
|
||||
|
||||
private val dotAdapter by lazy { DotAdapter() }
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.agileburo.anytype.ui.base
|
||||
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.lifecycle.Observer
|
||||
import com.agileburo.anytype.core_utils.common.Event
|
||||
import com.agileburo.anytype.core_utils.ui.BaseFragment
|
||||
import com.agileburo.anytype.presentation.navigation.AppNavigation
|
||||
import com.agileburo.anytype.presentation.navigation.AppNavigation.Command
|
||||
|
||||
abstract class NavigationFragment(
|
||||
@LayoutRes private val layout: Int
|
||||
) : BaseFragment(layout) {
|
||||
|
||||
val navObserver = Observer<Event<Command>> { event ->
|
||||
event.getContentIfNotHandled()?.let { navigate(it) }
|
||||
}
|
||||
|
||||
private fun navigate(command: Command) {
|
||||
|
||||
val navigation = (requireActivity() as AppNavigation.Provider).nav()
|
||||
|
||||
when (command) {
|
||||
is Command.OpenStartLoginScreen -> navigation.startLogin()
|
||||
is Command.OpenCreateProfile -> navigation.createProfile()
|
||||
is Command.ChoosePinCodeScreen -> navigation.choosePinCode()
|
||||
is Command.CongratulationScreen -> navigation.congratulation()
|
||||
is Command.EnterKeyChainScreen -> navigation.enterKeychain()
|
||||
is Command.ChooseProfileScreen -> navigation.chooseProfile()
|
||||
is Command.WorkspaceScreen -> navigation.workspace()
|
||||
is Command.SetupNewAccountScreen -> navigation.setupNewAccount()
|
||||
is Command.SetupSelectedAccountScreen -> navigation.setupSelectedAccount(command.id)
|
||||
is Command.ConfirmPinCodeScreen -> navigation.confirmPinCode(command.code)
|
||||
is Command.OpenProfile -> navigation.openProfile()
|
||||
is Command.OpenDocument -> navigation.openDocument(command.id)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.agileburo.anytype.ui.base
|
||||
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.lifecycle.Observer
|
||||
|
||||
abstract class ViewStateFragment<VS>(
|
||||
@LayoutRes private val layout: Int
|
||||
) : NavigationFragment(layout), Observer<VS> {
|
||||
override fun onChanged(state: VS) {
|
||||
render(state)
|
||||
}
|
||||
|
||||
abstract fun render(state: VS)
|
||||
}
|
|
@ -1,17 +1,17 @@
|
|||
package com.agileburo.anytype.feature_desktop.ui
|
||||
package com.agileburo.anytype.ui.desktop
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.feature_desktop.R
|
||||
import com.agileburo.anytype.feature_desktop.mvvm.DesktopView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.feature_desktop.utils.DesktopDiffUtil
|
||||
import com.agileburo.anytype.presentation.desktop.DesktopView
|
||||
|
||||
class DesktopAdapter(
|
||||
private val data : MutableList<DesktopView>,
|
||||
private val onDocumentClicked : (DesktopView.Document) -> Unit
|
||||
private val data: MutableList<DesktopView>,
|
||||
private val onDocumentClicked: (DesktopView.Document) -> Unit
|
||||
) : RecyclerView.Adapter<DesktopAdapter.ViewHolder>() {
|
||||
|
||||
companion object {
|
||||
|
@ -20,7 +20,7 @@ class DesktopAdapter(
|
|||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
return when(viewType) {
|
||||
return when (viewType) {
|
||||
VIEW_TYPE_DOCUMENT -> {
|
||||
inflater.inflate(R.layout.item_desktop_page, parent, false).let {
|
||||
ViewHolder.DocumentHolder(it)
|
||||
|
@ -40,7 +40,7 @@ class DesktopAdapter(
|
|||
override fun getItemCount(): Int = data.size
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
when(holder) {
|
||||
when (holder) {
|
||||
is ViewHolder.DocumentHolder -> {
|
||||
holder.bind(
|
||||
doc = data[position] as DesktopView.Document,
|
||||
|
@ -54,13 +54,13 @@ class DesktopAdapter(
|
|||
|
||||
class DocumentHolder(itemView: View) : ViewHolder(itemView) {
|
||||
|
||||
fun bind(doc : DesktopView.Document, onClick: (DesktopView.Document) -> Unit) {
|
||||
fun bind(doc: DesktopView.Document, onClick: (DesktopView.Document) -> Unit) {
|
||||
itemView.setOnClickListener { onClick(doc) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun update(views : List<DesktopView>) {
|
||||
fun update(views: List<DesktopView>) {
|
||||
|
||||
val callback = DesktopDiffUtil(
|
||||
old = data,
|
|
@ -1,11 +1,11 @@
|
|||
package com.agileburo.anytype.feature_desktop.utils
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import com.agileburo.anytype.feature_desktop.mvvm.DesktopView
|
||||
import com.agileburo.anytype.presentation.desktop.DesktopView
|
||||
|
||||
class DesktopDiffUtil(
|
||||
private val old : List<DesktopView>,
|
||||
private val new : List<DesktopView>
|
||||
private val old: List<DesktopView>,
|
||||
private val new: List<DesktopView>
|
||||
) : DiffUtil.Callback() {
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
|
@ -1,16 +1,17 @@
|
|||
package com.agileburo.anytype.feature_desktop.ui
|
||||
package com.agileburo.anytype.ui.desktop
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ui.ViewState
|
||||
import com.agileburo.anytype.feature_desktop.R
|
||||
import com.agileburo.anytype.feature_desktop.mvvm.DesktopView
|
||||
import com.agileburo.anytype.feature_desktop.mvvm.DesktopViewModel
|
||||
import com.agileburo.anytype.presentation.desktop.DesktopView
|
||||
import com.agileburo.anytype.presentation.desktop.DesktopViewModel
|
||||
import com.agileburo.anytype.ui.base.ViewStateFragment
|
||||
import kotlinx.android.synthetic.main.fragment_desktop.*
|
||||
|
||||
class DesktopFragment : FeatureBaseFragment<ViewState<List<DesktopView>>>(R.layout.fragment_desktop) {
|
||||
class DesktopFragment : ViewStateFragment<ViewState<List<DesktopView>>>(R.layout.fragment_desktop) {
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders.of(this).get(DesktopViewModel::class.java)
|
|
@ -0,0 +1,42 @@
|
|||
package com.agileburo.anytype.ui.main
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.navigation.Navigation
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.NavigationUI
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.navigation.Navigator
|
||||
import com.agileburo.anytype.presentation.navigation.AppNavigation
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class MainActivity : AppCompatActivity(), AppNavigation.Provider {
|
||||
|
||||
private val navigator by lazy { Navigator() }
|
||||
|
||||
@Inject
|
||||
lateinit var context: Context
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
NavigationUI.setupWithNavController(
|
||||
bottomNavigationView,
|
||||
Navigation.findNavController(this, R.id.fragment)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
navigator.bind(findNavController(R.id.fragment))
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
navigator.unbind()
|
||||
}
|
||||
|
||||
override fun nav(): AppNavigation = navigator
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.agileburo.anytype.ui.profile
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.agileburo.anytype.R
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
|
||||
class KeychainPhraseDialog : BottomSheetDialogFragment() {
|
||||
|
||||
companion object {
|
||||
fun newInstance(): KeychainPhraseDialog = KeychainPhraseDialog()
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.dialog_keychain_phrase, container, false)
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.agileburo.anytype.ui.profile
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ui.ViewState
|
||||
import com.agileburo.anytype.di.common.componentManager
|
||||
import com.agileburo.anytype.presentation.profile.ProfileView
|
||||
import com.agileburo.anytype.presentation.profile.ProfileViewModel
|
||||
import com.agileburo.anytype.presentation.profile.ProfileViewModelFactory
|
||||
import com.agileburo.anytype.ui.base.ViewStateFragment
|
||||
import kotlinx.android.synthetic.main.fragment_profile.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ProfileFragment : ViewStateFragment<ViewState<ProfileView>>(R.layout.fragment_profile) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: ProfileViewModelFactory
|
||||
|
||||
private val vm by lazy {
|
||||
ViewModelProviders
|
||||
.of(this, factory)
|
||||
.get(ProfileViewModel::class.java)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(this, this)
|
||||
vm.navigation.observe(this, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
override fun render(state: ViewState<ProfileView>) {
|
||||
when (state) {
|
||||
is ViewState.Init -> {
|
||||
logoutButton.setOnClickListener { vm.onLogoutClicked() }
|
||||
updateToggle.setOnCheckedChangeListener { _, isChecked ->
|
||||
vm.onUpdateToggled(value = isChecked)
|
||||
}
|
||||
invitesToggle.setOnCheckedChangeListener { _, isChecked ->
|
||||
vm.onInviteToggled(value = isChecked)
|
||||
}
|
||||
pinCodeText.setOnClickListener { vm.onPinCodeClicked() }
|
||||
keychainPhrase.setOnClickListener { vm.onKeyChainPhraseClicked() }
|
||||
backButton.setOnClickListener { vm.onBackButtonClicked() }
|
||||
}
|
||||
is ViewState.Success -> {
|
||||
name.text = state.data.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().profileComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().profileComponent.release()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.agileburo.anytype.ui.profile
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.core_utils.ui.ViewType
|
||||
import kotlinx.android.synthetic.main.item_select_profile_profile.view.*
|
||||
|
||||
class SelectProfileAdapter(
|
||||
private val models: MutableList<Model>,
|
||||
private val onAddProfileClicked: () -> Unit,
|
||||
private val onProfileClicked: (Model.Profile) -> Unit
|
||||
) : RecyclerView.Adapter<SelectProfileAdapter.ViewHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
return LayoutInflater.from(parent.context).let { inflater ->
|
||||
when (viewType) {
|
||||
PROFILE_HOLDER -> {
|
||||
inflater.inflate(
|
||||
R.layout.item_select_profile_profile,
|
||||
parent, false
|
||||
).let { view ->
|
||||
ViewHolder.ProfileViewHolder(view)
|
||||
}
|
||||
}
|
||||
ADD_PROFILE_HOLDER -> {
|
||||
inflater.inflate(
|
||||
R.layout.item_select_profile_add_profile,
|
||||
parent, false
|
||||
).let { view ->
|
||||
ViewHolder.AddProfileViewHolder(view)
|
||||
}
|
||||
}
|
||||
else -> throw IllegalStateException("Unexpected type: $viewType")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int) = models[position].getViewType()
|
||||
override fun getItemCount(): Int = models.size
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
when (holder) {
|
||||
is ViewHolder.ProfileViewHolder -> holder.bind(
|
||||
model = models[position],
|
||||
onClick = onProfileClicked
|
||||
)
|
||||
is ViewHolder.AddProfileViewHolder -> holder.bind(
|
||||
onClick = onAddProfileClicked
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun update(update: List<Model>) {
|
||||
models.apply {
|
||||
clear()
|
||||
addAll(update)
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
sealed class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
class ProfileViewHolder(view: View) : ViewHolder(view) {
|
||||
|
||||
fun bind(
|
||||
model: Model,
|
||||
onClick: (Model.Profile) -> Unit
|
||||
) {
|
||||
check(model is Model.Profile)
|
||||
itemView.apply {
|
||||
isSelected = model.active
|
||||
name.text = model.name
|
||||
status.text = model.status
|
||||
setOnClickListener { onClick(model) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AddProfileViewHolder(view: View) : ViewHolder(view) {
|
||||
fun bind(onClick: () -> Unit) {
|
||||
itemView.setOnClickListener { onClick() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sealed class Model : ViewType {
|
||||
data class Profile(
|
||||
val id: String,
|
||||
val name: String,
|
||||
val status: String,
|
||||
val active: Boolean = false
|
||||
) : Model() {
|
||||
override fun getViewType() = PROFILE_HOLDER
|
||||
}
|
||||
|
||||
object AddProfile : Model() {
|
||||
override fun getViewType() = ADD_PROFILE_HOLDER
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val PROFILE_HOLDER = 0
|
||||
const val ADD_PROFILE_HOLDER = 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.agileburo.anytype.ui.profile
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.agileburo.anytype.R
|
||||
import com.agileburo.anytype.ui.profile.SelectProfileAdapter
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.dialog_select_profile.*
|
||||
|
||||
class SelectProfileDialog : BottomSheetDialogFragment() {
|
||||
|
||||
private val selectProfileAdapter by lazy {
|
||||
SelectProfileAdapter(
|
||||
models = mutableListOf(
|
||||
SelectProfileAdapter.Model.Profile(
|
||||
name = "Konstantin Ivanov",
|
||||
id = "id",
|
||||
status = "20/100 peers",
|
||||
active = true
|
||||
),
|
||||
SelectProfileAdapter.Model.Profile(
|
||||
name = "Evgenii Kozlov",
|
||||
id = "id",
|
||||
status = "20/100 peers"
|
||||
),
|
||||
SelectProfileAdapter.Model.AddProfile
|
||||
),
|
||||
onProfileClicked = {},
|
||||
onAddProfileClicked = {}
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(): SelectProfileDialog = SelectProfileDialog()
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.dialog_select_profile, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
selectProfileRecycler.apply {
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
adapter = selectProfileAdapter
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/dark"/>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/blue" />
|
||||
</shape>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/blue"/>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#FF6055" />
|
||||
</shape>
|
30
app/src/main/res/drawable/gradient_rectangle.xml
Normal file
30
app/src/main/res/drawable/gradient_rectangle.xml
Normal file
|
@ -0,0 +1,30 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="360"
|
||||
android:viewportHeight="640">
|
||||
<path android:pathData="M0,0h360v667h-360z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="180"
|
||||
android:endY="667"
|
||||
android:startX="180"
|
||||
android:startY="0"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#FF91B5C1"
|
||||
android:offset="0" />
|
||||
<item
|
||||
android:color="#FFB9D5DA"
|
||||
android:offset="0.506158" />
|
||||
<item
|
||||
android:color="#FFCEC9BF"
|
||||
android:offset="0.794335" />
|
||||
<item
|
||||
android:color="#FFA49D8E"
|
||||
android:offset="1" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</vector>
|
12
app/src/main/res/drawable/ic_add_profile.xml
Normal file
12
app/src/main/res/drawable/ic_add_profile.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="17dp"
|
||||
android:viewportWidth="16"
|
||||
android:viewportHeight="17">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:pathData="M7,0.0233h2v16h-2z" />
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:pathData="M16,7.0233l-0,2l-16,0l-0,-2z" />
|
||||
</vector>
|
13
app/src/main/res/drawable/ic_check_sync.xml
Normal file
13
app/src/main/res/drawable/ic_check_sync.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="15dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="15"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:fillColor="#80B822"
|
||||
android:pathData="M7.5,8.4844m-7.5,0a7.5,7.5 0,1 1,15 0a7.5,7.5 0,1 1,-15 0" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M12.4243,5.4243L6,11.8485L2.5757,8.4243L3.4243,7.5757L6,10.1515L11.5757,4.5757L12.4243,5.4243Z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_clock.xml
Normal file
10
app/src/main/res/drawable/ic_clock.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="23dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="23"
|
||||
android:viewportHeight="26">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M13.9477,3.5606C13.982,3.379 14,3.1916 14,3C14,1.3432 12.6569,0 11,0C9.3432,0 8,1.3432 8,3C8,3.1916 8.018,3.379 8.0523,3.5606C5.0928,4.7342 3,7.6227 3,11L3,11.0208H3V16.1224C2.9697,16.3647 2.8218,16.9599 2.1011,17.0073C2.0702,17.0058 2.0391,17.0051 2.0078,17.0051C0.8989,17.0051 0,17.9041 0,19.0129C0,20.1218 0.8989,21.0208 2.0078,21.0208H2.0078H3H3.0078H19H20C20,21.0208 20,21.0208 20,21.0208C21.1089,21.0208 22.0078,20.1218 22.0078,19.0129C22.0078,17.9041 21.1089,17.0051 20,17.0051C19.9687,17.0051 19.9376,17.0058 19.9067,17.0073C18.9999,16.9477 19,16.0208 19,16.0208V11.0208V11C19,7.6227 16.9072,4.7342 13.9477,3.5606ZM11,25.0208C12.6569,25.0208 14,23.6776 14,22.0208H8C8,23.6776 9.3432,25.0208 11,25.0208Z" />
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_drag.xml
Normal file
9
app/src/main/res/drawable/ic_drag.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="4dp"
|
||||
android:viewportWidth="36"
|
||||
android:viewportHeight="4">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:pathData="M2,0L34,0A2,2 0,0 1,36 2L36,2A2,2 0,0 1,34 4L2,4A2,2 0,0 1,0 2L0,2A2,2 0,0 1,2 0z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_invite.xml
Normal file
10
app/src/main/res/drawable/ic_invite.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M0.2263,1.0749C0.0818,1.3516 0,1.6662 0,2V14C0,14.3338 0.0818,14.6484 0.2263,14.9251L7.1514,8L0.2263,1.0749ZM1.0748,0.2264L11.01,10.1615C11.5567,10.7083 12.4432,10.7083 12.9899,10.1615L22.9251,0.2263C22.6484,0.0818 22.3338,0 22,0H11.9612H2C1.6662,0 1.3515,0.0818 1.0748,0.2264ZM23.7736,1.0749L16.8485,8L23.7737,14.9251C23.9182,14.6484 24,14.3338 24,14V2C24,1.6662 23.9182,1.3515 23.7736,1.0749ZM22.9251,15.7736L16,8.8485L13.8384,11.0101C12.8231,12.0254 11.1768,12.0254 10.1615,11.0101L7.9999,8.8485L1.0749,15.7736C1.3515,15.9182 1.6662,16 2,16H22C22.3338,16 22.6485,15.9182 22.9251,15.7736Z" />
|
||||
</vector>
|
13
app/src/main/res/drawable/ic_key.xml
Normal file
13
app/src/main/res/drawable/ic_key.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="23dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="23"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:pathData="M11,8L15,12L12,15H9.5L9.5156,17.5H6.5V20.5H4L4,23L0,23.0428L0,19L11,8Z" />
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M11.0503,11.9497C13.7839,14.6834 18.2161,14.6834 20.9497,11.9497C23.6834,9.2161 23.6834,4.7839 20.9497,2.0503C18.2161,-0.6834 13.7839,-0.6834 11.0503,2.0503C8.3166,4.7839 8.3166,9.2161 11.0503,11.9497ZM16.6852,6.4034C17.4662,7.1844 18.7325,7.1844 19.5136,6.4034C20.2946,5.6223 20.2946,4.356 19.5136,3.575C18.7325,2.7939 17.4662,2.7939 16.6852,3.575C15.9041,4.356 15.9041,5.6223 16.6852,6.4034Z" />
|
||||
</vector>
|
|
@ -1,74 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path android:fillColor="#008577"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#008577"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
|
|
11
app/src/main/res/drawable/ic_open.xml
Normal file
11
app/src/main/res/drawable/ic_open.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M1.0911,13L7.0911,7L1.0911,1"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#ACA996" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_pin.xml
Normal file
10
app/src/main/res/drawable/ic_pin.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="26">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M5,11.0526H15V7.9901C15,5.2287 12.7614,2.9901 10,2.9901C7.2386,2.9901 5,5.2287 5,7.9901V11.0526ZM3,11.0526H2C0.8954,11.0526 0,11.9481 0,13.0526V23.0526C0,24.1572 0.8954,25.0526 2,25.0526H18C19.1046,25.0526 20,24.1572 20,23.0526V13.0526C20,11.9481 19.1046,11.0526 18,11.0526H17V7.9901C17,4.1241 13.866,0.9901 10,0.9901C6.134,0.9901 3,4.1241 3,7.9901V11.0526Z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_profile_back.xml
Normal file
10
app/src/main/res/drawable/ic_profile_back.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="13dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="13"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M12.1517,0.9393C12.7375,1.5251 12.7375,2.4749 12.1517,3.0607L4.2124,11L12.1517,18.9393C12.7375,19.5251 12.7375,20.4749 12.1517,21.0607C11.5659,21.6464 10.6162,21.6464 10.0304,21.0607L1.0304,12.0607C0.4446,11.4749 0.4446,10.5251 1.0304,9.9393L10.0304,0.9393C10.6162,0.3536 11.5659,0.3536 12.1517,0.9393Z" />
|
||||
</vector>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="#F7F5F0" />
|
||||
</shape>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="#F7F5F0" />
|
||||
</shape>
|
6
app/src/main/res/drawable/rectangle_orange_button.xml
Normal file
6
app/src/main/res/drawable/rectangle_orange_button.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/orange" />
|
||||
</shape>
|
8
app/src/main/res/drawable/rounded_dialog.xml
Normal file
8
app/src/main/res/drawable/rounded_dialog.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
</shape>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/rectangle_background_selected_profile" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/rectangle_background_profile_transparent" android:state_selected="false" />
|
||||
</selector>
|
|
@ -5,7 +5,7 @@
|
|||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
tools:context=".ui.main.MainActivity">
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottomNavigationView"
|
||||
|
@ -30,36 +30,4 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/graph" />
|
||||
|
||||
<!--
|
||||
<fragment
|
||||
android:id="@+id/keychain"
|
||||
android:name="com.agileburo.anytype.feature_login.ui.login.presentation.ui.keychain.KeychainLoginFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/create"
|
||||
android:name="com.agileburo.anytype.feature_login.ui.login.presentation.ui.profile.CreateAccountFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/choose"
|
||||
android:name="com.agileburo.anytype.feature_login.ui.login.presentation.ui.profile.SelectAccountFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/pin"
|
||||
android:name="com.agileburo.anytype.feature_login.ui.login.presentation.ui.pin.ChoosePinCodeFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/start"
|
||||
android:name="com.agileburo.anytype.feature_login.ui.login.presentation.ui.start.StartLoginFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />-->
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
90
app/src/main/res/layout/dialog_keychain_phrase.xml
Normal file
90
app/src/main/res/layout/dialog_keychain_phrase.xml
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/drag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="@drawable/ic_drag"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="@string/back_up_your_keychain_phrase"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drag" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="@string/keychain_phrase_text"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/keychain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="34dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/rectangle_keychain_background"
|
||||
android:fontFamily="monospace"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:text="@string/keychain_mock"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/subtitle"
|
||||
tools:text="@string/keychain_mock" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/doneButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:background="@drawable/rectangle_orange_button"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:stateListAnimator="@animator/scale_shrink"
|
||||
android:text="@string/i_ve_written_it_down"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/keychain"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
24
app/src/main/res/layout/dialog_select_profile.xml
Normal file
24
app/src/main/res/layout/dialog_select_profile.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/drag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="@drawable/ic_drag" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/selectProfileRecycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
tools:listitem="@layout/item_select_profile_profile" />
|
||||
</LinearLayout>
|
|
@ -41,8 +41,8 @@
|
|||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
style="@style/HeaderStyle"
|
||||
android:id="@+id/congratulationText"
|
||||
style="@style/HeaderStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
|
@ -52,14 +52,14 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/image" />
|
||||
|
||||
<TextView
|
||||
android:text="@string/you_ve_created_your_first_profile"
|
||||
android:id="@+id/subtitle"
|
||||
android:textColor="@color/black"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/you_ve_created_your_first_profile"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/white"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
|
@ -55,12 +55,12 @@
|
|||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
app:backgroundTint="@color/orange"
|
||||
android:src="@drawable/ic_add_doc"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:src="@drawable/ic_add_doc"
|
||||
app:backgroundTint="@color/orange"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
48
app/src/main/res/layout/fragment_enter_pin_code.xml
Normal file
48
app/src/main/res/layout/fragment_enter_pin_code.xml
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/HeaderStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/enter_pin_code"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/dotRecycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title"
|
||||
app:layout_constraintStart_toStartOf="@+id/title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
tools:listitem="@layout/item_dot" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/numPadRecycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dotRecycler"
|
||||
app:spanCount="3"
|
||||
tools:listitem="@layout/item_num_pad_number" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -2,8 +2,8 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
@ -25,11 +25,11 @@
|
|||
android:layout_marginEnd="24dp"
|
||||
android:background="@null"
|
||||
android:hint="@string/type_your_keychain"
|
||||
android:textColorHint="@color/keychain_hint_color"
|
||||
android:textStyle="bold"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:textColorHint="@color/keychain_hint_color"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
315
app/src/main/res/layout/fragment_profile.xml
Normal file
315
app/src/main/res/layout/fragment_profile.xml
Normal file
|
@ -0,0 +1,315 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/gradient_rectangle"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/backButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:src="@drawable/ic_profile_back" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pic"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:contentDescription="@string/description_profile_picture"
|
||||
android:src="@drawable/circle_red"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pic"
|
||||
tools:text="Anton Pronkin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/syncStatus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:drawableStart="@drawable/ic_check_sync"
|
||||
android:drawablePadding="8dp"
|
||||
android:text="Synced with 32/129 peers"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/name"
|
||||
tools:text="Synced with 32/129 peers" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/syncStatus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switchProfileButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/switch_profile"
|
||||
android:textColor="#ACA996"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/keyIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:src="@drawable/ic_key"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/firstArrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/ic_open"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/keychainPhrase"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/keychainPhrase" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/keychainPhrase"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/keychain_phrase"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/keyIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/firstArrow"
|
||||
app:layout_constraintStart_toEndOf="@+id/keyIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/keyIcon" />
|
||||
|
||||
<View
|
||||
android:id="@+id/firstDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintEnd_toEndOf="@+id/firstArrow"
|
||||
app:layout_constraintStart_toStartOf="@+id/keychainPhrase"
|
||||
app:layout_constraintTop_toBottomOf="@+id/keychainPhrase" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pinCodeIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:src="@drawable/ic_pin"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/firstDivider" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/secondArrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/ic_open"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/pinCodeText"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/pinCodeText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pinCodeText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/pin_code"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/pinCodeIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/secondArrow"
|
||||
app:layout_constraintStart_toEndOf="@+id/pinCodeIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/pinCodeIcon" />
|
||||
|
||||
<View
|
||||
android:id="@+id/secondDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintEnd_toEndOf="@+id/secondArrow"
|
||||
app:layout_constraintStart_toStartOf="@+id/pinCodeText"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pinCodeText" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/clockIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:src="@drawable/ic_clock"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/secondDivider" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/updateToggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/updatesText"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/updatesText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/updatesText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/updates"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/clockIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/updateToggle"
|
||||
app:layout_constraintStart_toEndOf="@+id/clockIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/clockIcon" />
|
||||
|
||||
<View
|
||||
android:id="@+id/thirdDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintEnd_toEndOf="@+id/updateToggle"
|
||||
app:layout_constraintStart_toStartOf="@+id/updatesText"
|
||||
app:layout_constraintTop_toBottomOf="@+id/updatesText" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/invitesIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:src="@drawable/ic_invite"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/thirdDivider" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/invitesToggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/invitesText"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/invitesText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/invitesText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="Invites"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/invitesIcon"
|
||||
app:layout_constraintEnd_toStartOf="@+id/invitesToggle"
|
||||
app:layout_constraintStart_toEndOf="@+id/invitesIcon"
|
||||
app:layout_constraintTop_toTopOf="@+id/invitesIcon" />
|
||||
|
||||
<View
|
||||
android:id="@+id/fourthDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/invitesToggle"
|
||||
app:layout_constraintStart_toStartOf="@+id/invitesText"
|
||||
app:layout_constraintTop_toBottomOf="@+id/invitesText" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/logoutButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/log_out"
|
||||
android:textColor="#E1320A"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/white"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue