From d34fce005f78d839db94dac8a6593c0bb6c9b8eb Mon Sep 17 00:00:00 2001 From: nvllz <110673332+nvllz@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:24:03 +0000 Subject: [PATCH 1/2] IvyFeatures screen rephrasals (#3591) * ivyfeatures-text-enhancement * ivyfeatures-text-enhancement * remove-redundant-quotation-marks --- .../transaction/EditTransactionViewModel.kt | 6 ++-- .../java/com/ivy/domain/features/Features.kt | 2 +- .../com/ivy/domain/features/IvyFeatures.kt | 35 +++++++++---------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt index 4d2adfa7c3..189a657e86 100644 --- a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt +++ b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt @@ -987,14 +987,14 @@ class EditTransactionViewModel @Inject constructor( private suspend fun sortCategories(): ImmutableList { 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) } } diff --git a/shared/domain/src/main/java/com/ivy/domain/features/Features.kt b/shared/domain/src/main/java/com/ivy/domain/features/Features.kt index af043582b2..eeb8a27ada 100644 --- a/shared/domain/src/main/java/com/ivy/domain/features/Features.kt +++ b/shared/domain/src/main/java/com/ivy/domain/features/Features.kt @@ -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 diff --git a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt index 900a0b9b47..b422e296cd 100644 --- a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt +++ b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt @@ -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 get() = listOf( - sortCategoriesAlphabetically, + sortCategoriesAscending, compactAccountsMode, compactCategoriesMode, showTitleSuggestions, From ec621e743f8082c9370164dadd4e05c553460d51 Mon Sep 17 00:00:00 2001 From: Andrii <39765531+AndreVero@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:47:01 +0100 Subject: [PATCH 2/2] Add widget compact divider (#3594) --- .../src/main/res/drawable/widget_compact_divider.xml | 6 ++++++ .../src/main/res/layout/widget_add_transaction_compact.xml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 widget/add-transaction/src/main/res/drawable/widget_compact_divider.xml diff --git a/widget/add-transaction/src/main/res/drawable/widget_compact_divider.xml b/widget/add-transaction/src/main/res/drawable/widget_compact_divider.xml new file mode 100644 index 0000000000..d555fc4ce9 --- /dev/null +++ b/widget/add-transaction/src/main/res/drawable/widget_compact_divider.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/widget/add-transaction/src/main/res/layout/widget_add_transaction_compact.xml b/widget/add-transaction/src/main/res/layout/widget_add_transaction_compact.xml index c031d7a7c3..fa2726c814 100644 --- a/widget/add-transaction/src/main/res/layout/widget_add_transaction_compact.xml +++ b/widget/add-transaction/src/main/res/layout/widget_add_transaction_compact.xml @@ -18,6 +18,8 @@ android:paddingLeft="16dp" android:paddingTop="12dp" android:paddingRight="16dp" + android:showDividers="middle" + android:divider="@drawable/widget_compact_divider" android:paddingBottom="14dp">