mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-10 05:03:44 +01:00
Minor tweaks to the loading bar
This commit is contained in:
parent
a023260bf2
commit
789d992deb
@ -113,13 +113,14 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
|
|||||||
ProgressBar progressBar = view.findViewById(R.id.sync_progress_bar);
|
ProgressBar progressBar = view.findViewById(R.id.sync_progress_bar);
|
||||||
if(blockchainService != null) {
|
if(blockchainService != null) {
|
||||||
blockchainService.height.observe(getViewLifecycleOwner(), height -> {
|
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();
|
int syncPct = (int)blockchainService.getSyncPercentage();
|
||||||
progressBar.setIndeterminate(height < 1 || daemonHeight <= 0);
|
progressBar.setIndeterminate(height <= 1 || daemonHeight <= 0);
|
||||||
if(height > 1 && daemonHeight > 1) {
|
if(height > 1 && daemonHeight > 1) {
|
||||||
progressBar.setProgress(syncPct);
|
progressBar.setProgress(syncPct);
|
||||||
|
|
||||||
if(WalletManager.getInstance().getWallet().isSynchronized()) {
|
if(wallet.isSynchronized()) {
|
||||||
progressBar.setVisibility(View.INVISIBLE);
|
progressBar.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user