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

Commit 5382191

Browse files
committed
fix-issue-3488
1 parent 256a9a8 commit 5382191

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

Diff for: screen/categories/src/main/java/com/ivy/categories/CategoriesScreen.kt

+86
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,12 @@ private fun PreviewCategoriesCompactModeEnabled(theme: Theme = Theme.LIGHT) {
686686
Preview(theme = theme, compactModeEnabled = true)
687687
}
688688

689+
@Preview
690+
@Composable
691+
private fun PreviewCategoriesCompactModeEnabledAndSearchBarEnabled(theme: Theme = Theme.LIGHT) {
692+
Preview(theme = theme, compactModeEnabled = true, displaySearchBarEnabled = true)
693+
}
694+
689695
@Preview
690696
@Composable
691697
private fun Preview(
@@ -766,6 +772,86 @@ private fun Preview(
766772
}
767773
}
768774

775+
@Preview
776+
@Composable
777+
private fun PreviewWithSearchBarEnabled(
778+
theme: Theme = Theme.LIGHT,
779+
compactModeEnabled: Boolean = false,
780+
displaySearchBarEnabled: Boolean = true
781+
) {
782+
com.ivy.legacy.IvyWalletPreview(theme) {
783+
val state = CategoriesScreenState(
784+
baseCurrency = "BGN",
785+
compactCategoriesModeEnabled = compactModeEnabled,
786+
showCategorySearchBar = displaySearchBarEnabled,
787+
categories = persistentListOf(
788+
CategoryData(
789+
category = Category(
790+
id = CategoryId(UUID.randomUUID()),
791+
name = NotBlankTrimmedString.unsafe("Groceries"),
792+
color = ColorInt(Green.toArgb()),
793+
icon = IconAsset.unsafe("groceries"),
794+
orderNum = 0.0,
795+
),
796+
monthlyBalance = 2125.0,
797+
monthlyExpenses = 920.0,
798+
monthlyIncome = 3045.0
799+
),
800+
CategoryData(
801+
category = Category(
802+
id = CategoryId(UUID.randomUUID()),
803+
name = NotBlankTrimmedString.unsafe("Fun"),
804+
color = ColorInt(Orange.toArgb()),
805+
icon = IconAsset.unsafe("game"),
806+
orderNum = 0.0,
807+
),
808+
monthlyBalance = 1200.0,
809+
monthlyExpenses = 750.0,
810+
monthlyIncome = 0.0
811+
),
812+
CategoryData(
813+
category = Category(
814+
id = CategoryId(UUID.randomUUID()),
815+
name = NotBlankTrimmedString.unsafe("Ivy"),
816+
color = ColorInt(IvyDark.toArgb()),
817+
icon = IconAsset.unsafe("star"),
818+
orderNum = 0.0,
819+
),
820+
monthlyBalance = 1200.0,
821+
monthlyExpenses = 0.0,
822+
monthlyIncome = 5000.0
823+
),
824+
CategoryData(
825+
category = Category(
826+
id = CategoryId(UUID.randomUUID()),
827+
name = NotBlankTrimmedString.unsafe("Food"),
828+
color = ColorInt(GreenLight.toArgb()),
829+
icon = IconAsset.unsafe("atom"),
830+
orderNum = 0.0,
831+
),
832+
monthlyBalance = 12125.21,
833+
monthlyExpenses = 1350.50,
834+
monthlyIncome = 8000.48
835+
),
836+
CategoryData(
837+
category = Category(
838+
id = CategoryId(UUID.randomUUID()),
839+
name = NotBlankTrimmedString.unsafe("Shisha"),
840+
color = ColorInt(GreenDark.toArgb()),
841+
icon = IconAsset.unsafe("drink"),
842+
orderNum = 0.0,
843+
),
844+
monthlyBalance = 820.0,
845+
monthlyExpenses = 340.0,
846+
monthlyIncome = 400.0
847+
),
848+
849+
)
850+
)
851+
UI(state = state)
852+
}
853+
}
854+
769855
@Composable
770856
private fun SearchField(
771857
onSearch: (String) -> Unit,

0 commit comments

Comments
 (0)