From 765ff8f29176051145776c52a74b80bb1ebad0cf Mon Sep 17 00:00:00 2001 From: pokkst Date: Mon, 12 Sep 2022 16:25:19 -0500 Subject: [PATCH] add gradient to bottom of screen to hide tx list bottom, also fixes app startup issue, and only displays most recent 100 txs --- .../com/m2049r/xmrwallet/MainActivity.java | 3 +- .../xmrwallet/fragment/home/HomeFragment.java | 6 +- app/src/main/res/drawable/gradient_bottom.xml | 9 +++ app/src/main/res/layout/fragment_home.xml | 79 ++++++++++++------- .../res/layout/transaction_history_item.xml | 3 +- 5 files changed, 67 insertions(+), 33 deletions(-) create mode 100644 app/src/main/res/drawable/gradient_bottom.xml diff --git a/app/src/main/java/com/m2049r/xmrwallet/MainActivity.java b/app/src/main/java/com/m2049r/xmrwallet/MainActivity.java index 6a4e0ba..9ce3c14 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/MainActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/MainActivity.java @@ -38,7 +38,8 @@ public class MainActivity extends AppCompatActivity implements MoneroHandlerThre super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); File walletFile = new File(getApplicationInfo().dataDir, Constants.WALLET_NAME); - if (walletFile.exists()) { + File walletKeysFile = new File(getApplicationInfo().dataDir, Constants.WALLET_NAME + ".keys"); + if (walletKeysFile.exists()) { boolean promptPassword = PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false); if (!promptPassword) { init(walletFile, ""); diff --git a/app/src/main/java/com/m2049r/xmrwallet/fragment/home/HomeFragment.java b/app/src/main/java/com/m2049r/xmrwallet/fragment/home/HomeFragment.java index 831c3f1..4e4f06a 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/fragment/home/HomeFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/fragment/home/HomeFragment.java @@ -141,7 +141,11 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI txHistoryRecyclerView.setVisibility(View.GONE); } else { Collections.sort(history); - adapter.submitList(history); + if(history.size() > 100) { + adapter.submitList(history.subList(0, 99)); + } else { + adapter.submitList(history); + } txHistoryRecyclerView.setVisibility(View.VISIBLE); } }); diff --git a/app/src/main/res/drawable/gradient_bottom.xml b/app/src/main/res/drawable/gradient_bottom.xml new file mode 100644 index 0000000..f5f5fd5 --- /dev/null +++ b/app/src/main/res/drawable/gradient_bottom.xml @@ -0,0 +1,9 @@ + + + + diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index fcd0aa0..177cd22 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -20,14 +20,15 @@ @@ -37,8 +38,7 @@ android:layout_height="wrap_content" android:layout_marginStart="24dp" android:layout_marginEnd="24dp" - android:textAlignment="center" - tools:text="LOCKED BALANCE" + tools:text="+ 100.000000000000 confirming" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/balance_unlocked_textview" /> @@ -46,39 +46,60 @@ -