mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-12-22 13:07:46 +00:00
Minor tweaks to the loading bar
This commit is contained in:
parent
a023260bf2
commit
789d992deb
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue