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

Commit

Permalink
WIP: Rework transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 29, 2022
1 parent fe82974 commit 74feb23
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.ivy.wallet.domain.data

interface TransactionHistoryItem {
}
interface TransactionHistoryItem
1 change: 0 additions & 1 deletion app/src/main/java/com/ivy/wallet/ui/home/HomeTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ fun HomeLazyColumn(
}

transactions(
ivyContext = ivyContext,
nav = nav,
upcoming = upcoming,
upcomingExpanded = upcomingExpanded,
Expand Down
21 changes: 10 additions & 11 deletions app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,16 @@ private fun BoxWithConstraintsScope.UI(

if (state.filter != null) {
transactions(
ivyContext = ivyContext,
nav = nav,
baseCurrency = state.baseCurrency,
upcoming = state.upcomingTransactions,
upcomingExpanded = state.upcomingExpanded,

setUpcomingExpanded = {
onEventHandler.invoke(ReportScreenEvent.OnUpcomingExpanded(upcomingExpanded = it))
},
baseCurrency = state.baseCurrency,
upcomingIncome = state.upcomingIncome,
upcomingExpenses = state.upcomingExpenses,
overdueIncome = state.overdueIncome,
overdueExpenses = state.overdueExpenses,

categories = state.categories,
accounts = state.accounts,
Expand All @@ -213,15 +215,12 @@ private fun BoxWithConstraintsScope.UI(
onEventHandler.invoke(ReportScreenEvent.OnOverdueExpanded(overdueExpanded = it))
},

history = state.history,

upcoming = state.upcomingTransactions,
upcomingExpanded = state.upcomingExpanded,
setUpcomingExpanded = {
onEventHandler.invoke(ReportScreenEvent.OnUpcomingExpanded(upcomingExpanded = it))
},
overdueIncome = state.overdueIncome,

overdueExpenses = state.overdueExpenses,
history = state.history,
lastItemSpacer = 48.dp,

onPayOrGet = {
onEventHandler.invoke(ReportScreenEvent.OnPayOrGet(transaction = it))
},
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ private fun UI(

) {
transactions(
ivyContext = ivyContext,
nav = nav,
upcoming = emptyList(),
upcomingExpanded = false,
Expand All @@ -124,9 +123,12 @@ private fun UI(
overdueExpenses = 0.0,
history = transactions,
onPayOrGet = { },
dateDividerMarginTop = 16.dp,
emptyStateTitle = stringRes(R.string.no_transactions),
emptyStateText = stringRes(R.string.no_transactions_for_query, searchQueryTextFieldValue.text)
emptyStateText = stringRes(
R.string.no_transactions_for_query,
searchQueryTextFieldValue.text
),
dateDividerMarginTop = 16.dp
)

item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,33 +336,31 @@ private fun BoxWithConstraintsScope.UI(
}

transactions(
ivyContext = ivyContext,
nav = nav,
upcoming = upcoming,
upcomingExpanded = upcomingExpanded,
setUpcomingExpanded = setUpcomingExpanded,

baseCurrency = baseCurrency,
upcomingIncome = upcomingIncome,

upcomingIncome = upcomingIncome,
upcomingExpenses = upcomingExpenses,

categories = categories,
accounts = accounts,
listState = listState,
overdue = overdue,

overdueExpanded = overdueExpanded,

setOverdueExpanded = setOverdueExpanded,
overdueIncome = overdueIncome,
overdueExpenses = overdueExpenses,
history = history,

lastItemSpacer = with(density) {
(ivyContext.screenHeight * 0.7f).toDp()
},

onPayOrGet = onPayOrGet,
emptyStateTitle = stringRes(R.string.no_transactions),

emptyStateText = stringRes(
R.string.no_transactions_for_period,
period.toDisplayLong(ivyContext.startDayOfMonth)
Expand Down
Loading

0 comments on commit 74feb23

Please sign in to comment.