Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
IvyFeatures screen rephrasals (#3591)
Browse files Browse the repository at this point in the history
* ivyfeatures-text-enhancement

* ivyfeatures-text-enhancement

* remove-redundant-quotation-marks
  • Loading branch information
nvllz authored Oct 7, 2024
1 parent 6158f6f commit d34fce0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -987,14 +987,14 @@ class EditTransactionViewModel @Inject constructor(

private suspend fun sortCategories(): ImmutableList<Category> {
val categories = categoryRepository.findAll()
return if (shouldSortCategoriesAlphabetically()) {
return if (shouldSortCategoriesAscending()) {
categories.sortedBy { it.name.value }.toImmutableList()
} else {
categories.toImmutableList()
}
}

private suspend fun shouldSortCategoriesAlphabetically(): Boolean {
return features.sortCategoriesAlphabetically.isEnabled(context)
private suspend fun shouldSortCategoriesAscending(): Boolean {
return features.sortCategoriesAscending.isEnabled(context)
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.domain.features

interface Features {
val sortCategoriesAlphabetically: BoolFeature
val sortCategoriesAscending: BoolFeature
val compactAccountsMode: BoolFeature
val compactCategoriesMode: BoolFeature
val showTitleSuggestions: BoolFeature
Expand Down
35 changes: 17 additions & 18 deletions shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,62 @@ import javax.inject.Singleton
@Singleton
class IvyFeatures @Inject constructor() : Features {

override val sortCategoriesAlphabetically = BoolFeature(
key = "sort_categories_alphabetically",
override val sortCategoriesAscending = BoolFeature(
key = "sort_categories_ascending",
group = FeatureGroup.Category,
name = "Sort Categories Alphabetically",
description = "Sort income and expenses" +
" categories alphabetically"
name = "Sort categories list",
description = "Show categories in ascending order (A-Z) on the transaction entry screen"
)

override val compactAccountsMode = BoolFeature(
key = "compact_account_ui",
group = FeatureGroup.Account,
name = "Compact account UI",
description = "Enables more compact and dense UI for the \"Accounts\" tab"
name = "Compact account cards",
description = "Make the Accounts tab UI more compact and dense"
)

override val compactCategoriesMode = BoolFeature(
key = "compact_categories_ui",
key = "compact_category_ui",
group = FeatureGroup.Category,
name = "Compact category UI",
description = "Activates a more streamlined and space-efficient interface for the \"Categories\" Screen"
name = "Compact category cards",
description = "Simplified design of the Categories screen"
)

override val showTitleSuggestions = BoolFeature(
key = "show_title_suggestions",
group = FeatureGroup.Other,
name = "Show previous title suggestions",
description = "Enables display of previous transaction titles when editing or creating a new transaction",
description = "Suggest past transaction titles when creating a new entry",
defaultValue = true
)

override val showCategorySearchBar = BoolFeature(
key = "search_categories",
group = FeatureGroup.Category,
name = "Search categories",
description = "Show search bar in category screen",
name = "Search within categories",
description = "Display a search bar on the Categories screen",
defaultValue = true
)

override val hideTotalBalance = BoolFeature(
key = "hide_total_balance",
group = FeatureGroup.Account,
name = "Hide total balance",
description = "Enable hide the total balance from the accounts tab",
name = "Hide account total balance",
description = "Replace the total balance values with asterisks on the Accounts screen",
defaultValue = false
)

override val showDecimalNumber = BoolFeature(
key = "show_decimal_number",
group = FeatureGroup.Other,
name = "Show Decimal Number",
description = "Whether to show the decimal part in amounts",
name = "Show values with decimals",
description = "Include the decimal part in amounts",
defaultValue = true
)

override val allFeatures: List<BoolFeature>
get() = listOf(
sortCategoriesAlphabetically,
sortCategoriesAscending,
compactAccountsMode,
compactCategoriesMode,
showTitleSuggestions,
Expand Down

0 comments on commit d34fce0

Please sign in to comment.