This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate screen-onboarding to ComposeViewModel and new architecture * Fix and format the code * Incorporate suggested changes
- Loading branch information
Showing
8 changed files
with
221 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
screen-onboarding/src/main/java/com/ivy/onboarding/OnboardingDetailState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.ivy.onboarding | ||
|
||
import androidx.compose.runtime.Immutable | ||
import com.ivy.legacy.data.model.AccountBalance | ||
import com.ivy.legacy.datamodel.Category | ||
import com.ivy.wallet.domain.data.IvyCurrency | ||
import com.ivy.wallet.domain.deprecated.logic.model.CreateAccountData | ||
import com.ivy.wallet.domain.deprecated.logic.model.CreateCategoryData | ||
import kotlinx.collections.immutable.ImmutableList | ||
|
||
@Immutable | ||
data class OnboardingDetailState( | ||
val currency: IvyCurrency, | ||
val accounts: ImmutableList<AccountBalance>, | ||
val accountSuggestions: ImmutableList<CreateAccountData>, | ||
val categories: ImmutableList<Category>, | ||
val categorySuggestions: ImmutableList<CreateCategoryData> | ||
) |
26 changes: 26 additions & 0 deletions
26
screen-onboarding/src/main/java/com/ivy/onboarding/OnboardingEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.ivy.onboarding | ||
|
||
import com.ivy.legacy.datamodel.Account | ||
import com.ivy.legacy.datamodel.Category | ||
import com.ivy.wallet.domain.data.IvyCurrency | ||
import com.ivy.wallet.domain.deprecated.logic.model.CreateAccountData | ||
import com.ivy.wallet.domain.deprecated.logic.model.CreateCategoryData | ||
|
||
sealed interface OnboardingEvent { | ||
|
||
data object LoginWithGoogle : OnboardingEvent | ||
data object LoginOfflineAccount : OnboardingEvent | ||
data object StartImport : OnboardingEvent | ||
data object ImportSkip : OnboardingEvent | ||
data class ImportFinished(val success: Boolean) : OnboardingEvent | ||
data object StartFresh : OnboardingEvent | ||
data class SetBaseCurrency(val baseCurrency: IvyCurrency) : OnboardingEvent | ||
data class EditAccount(val account: Account, val newBalance: Double) : OnboardingEvent | ||
data class CreateAccount(val data: CreateAccountData) : OnboardingEvent | ||
data object OnAddAccountsDone : OnboardingEvent | ||
data object OnAddAccountsSkip : OnboardingEvent | ||
data class EditCategory(val updatedCategory: Category) : OnboardingEvent | ||
data class CreateCategory(val data: CreateCategoryData) : OnboardingEvent | ||
data object OnAddCategoriesDone : OnboardingEvent | ||
data object OnAddCategoriesSkip : OnboardingEvent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
screen-onboarding/src/main/java/com/ivy/onboarding/OnboardingState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.