From 0682c6b3d3f7cef22725f3db15916346fdc4529e Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 16 Apr 2020 13:37:45 -0300 Subject: [wallet] change main screen if there is only one currency If there is more than one currency, the screen shows a list of balances per currency like it used to. If there is only one currency, the main screen directly shows the list of transactions with the balance in the toolbar. --- wallet/src/main/res/layout/fragment_balances.xml | 43 +++++++++++++++++++ wallet/src/main/res/layout/fragment_main.xml | 22 ++-------- .../src/main/res/layout/fragment_transactions.xml | 7 ++- wallet/src/main/res/menu/fragment_main.xml | 19 -------- wallet/src/main/res/navigation/nav_graph.xml | 50 ++++++++++++---------- wallet/src/main/res/values/strings.xml | 1 + 6 files changed, 81 insertions(+), 61 deletions(-) create mode 100644 wallet/src/main/res/layout/fragment_balances.xml delete mode 100644 wallet/src/main/res/menu/fragment_main.xml (limited to 'wallet/src/main/res') diff --git a/wallet/src/main/res/layout/fragment_balances.xml b/wallet/src/main/res/layout/fragment_balances.xml new file mode 100644 index 0000000..84c7bca --- /dev/null +++ b/wallet/src/main/res/layout/fragment_balances.xml @@ -0,0 +1,43 @@ + + + + + + + + diff --git a/wallet/src/main/res/layout/fragment_main.xml b/wallet/src/main/res/layout/fragment_main.xml index 57fe73e..81121b5 100644 --- a/wallet/src/main/res/layout/fragment_main.xml +++ b/wallet/src/main/res/layout/fragment_main.xml @@ -15,29 +15,13 @@ --> - - - + android:layout_height="match_parent" /> @@ -23,7 +24,11 @@ android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" - android:scrollbars="vertical" /> + android:scrollbars="vertical" + android:visibility="invisible" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + tools:listitem="@layout/list_item_transaction" + tools:visibility="visible" /> - - - diff --git a/wallet/src/main/res/navigation/nav_graph.xml b/wallet/src/main/res/navigation/nav_graph.xml index ef0f48b..f8d515e 100644 --- a/wallet/src/main/res/navigation/nav_graph.xml +++ b/wallet/src/main/res/navigation/nav_graph.xml @@ -18,21 +18,24 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/nav_graph" - app:startDestination="@id/showBalance" - tools:ignore="UnusedNavigation"> + app:startDestination="@id/nav_main"> + tools:layout="@layout/fragment_balances"> + + + app:popUpTo="@id/nav_main" /> + app:popUpTo="@id/nav_main" /> + + android:label="@string/menu_settings" /> - - + tools:layout="@layout/fragment_transactions" /> + app:popUpTo="@id/nav_main" /> + app:popUpTo="@id/nav_main" /> @@ -103,8 +103,9 @@ + + app:popUpTo="@id/nav_main" /> + - \ No newline at end of file + + + diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml index e0b3183..b4af3b8 100644 --- a/wallet/src/main/res/values/strings.xml +++ b/wallet/src/main/res/values/strings.xml @@ -80,6 +80,7 @@ Hide Details Payment was successful OK + Already paid You\'ve already paid for this order. Withdrawal accepted -- cgit v1.2.3