From 789d992debdaab5fa81c4034f63b9b9df535cb2a Mon Sep 17 00:00:00 2001 From: pokkst Date: Thu, 8 Sep 2022 00:04:40 -0500 Subject: [PATCH] Minor tweaks to the loading bar --- .../com/m2049r/xmrwallet/fragment/home/HomeFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 92c7950..f1f6072 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 @@ -113,13 +113,14 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI ProgressBar progressBar = view.findViewById(R.id.sync_progress_bar); if(blockchainService != null) { blockchainService.height.observe(getViewLifecycleOwner(), height -> { - long daemonHeight = WalletManager.getInstance().getWallet().getDaemonBlockChainHeight(); + Wallet wallet = WalletManager.getInstance().getWallet(); + long daemonHeight = wallet.getDaemonBlockChainHeight(); int syncPct = (int)blockchainService.getSyncPercentage(); - progressBar.setIndeterminate(height < 1 || daemonHeight <= 0); + progressBar.setIndeterminate(height <= 1 || daemonHeight <= 0); if(height > 1 && daemonHeight > 1) { progressBar.setProgress(syncPct); - if(WalletManager.getInstance().getWallet().isSynchronized()) { + if(wallet.isSynchronized()) { progressBar.setVisibility(View.INVISIBLE); } }