Empty states: Image (top) + text (bottom) on Home and Expenses #33
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Enhancement / UX
Both the Home and Expenses screens render an empty state as a single line of text:
app/src/main/java/dev/achmad/ledgerr/ui/screens/home/HomeScreen.kt:232-239—Text(stringResource(R.string.home_dashboard_empty), …)("No expenses yet for this period") inside aLazyColumnitem.app/src/main/java/dev/achmad/ledgerr/ui/screens/expenses/ExpenseListScreen.kt:242-254—Text(stringResource(R.string.expense_list_empty), …)inside aBox(Modifier.fillMaxSize(), contentAlignment = Center).The text floats in the middle of the list area but feels uninviting. The user wants a centered Image (top) + text (bottom) column.
Expected behavior
Replace the empty states with a new shared composable, e.g.
EmptyStateIllustration(suggested location:app/src/main/java/dev/achmad/ledgerr/ui/components/EmptyStateIllustration.kt), with this layout:Image asset
app/src/main/res/drawable/(vector /xmlif possible) — call itill_empty.xml(or similar). A simple, on-brand line illustration is fine: a wallet, a receipt, or a "no data" mark. The size should look balanced at ~120.dp.Imageslot can be filled with a Material symbol (e.g.Icons.Outlined.ReceiptLongorIcons.Outlined.Inbox) as a placeholder — just keep the sameModifier.size(120.dp)andcolorFiltertreatment so the visual weight is identical.Call sites
HomeScreen.kt:231-240(theelsebranch ofif (recent.isNotEmpty())). The current code is aLazyColumnitem { Text(...) }. The image+text column needs the remaining space, not just its own intrinsic height. Refactor the empty branch to render outside theLazyColumn(e.g. wrapDashboardContentin aBox, render the list as one child, renderEmptyStateIllustrationas a sibling that fills the remaining space and shows whenrecent.isEmpty()), OR keep the item but applyModifier.fillParentMaxSize()and the same column layout.ExpenseListScreen.kt:242-254(the empty branch inExpensesTabContent). Already wrapped inBox(fillMaxSize, contentAlignment = Center), so swapping theTextfor the newEmptyStateIllustration(message = stringResource(R.string.expense_list_empty))is essentially a one-line change.Acceptance criteria
onSurfaceVarianttint viacolorFilter).R.string.home_dashboard_empty,R.string.expense_list_empty) are still used — no copy changes required for this slice.