Don't flicker with nav drawer loading indicator when refreshing

This commit is contained in:
ByteHamster 2021-02-16 22:20:01 +01:00
parent cf2d1006df
commit 32afda252e
1 changed files with 1 additions and 2 deletions

View File

@ -331,7 +331,6 @@ public class NavDrawerFragment extends Fragment implements AdapterView.OnItemCli
}; };
private void loadData() { private void loadData() {
progressBar.setVisibility(View.VISIBLE);
disposable = Observable.fromCallable(DBReader::getNavDrawerData) disposable = Observable.fromCallable(DBReader::getNavDrawerData)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
@ -340,7 +339,7 @@ public class NavDrawerFragment extends Fragment implements AdapterView.OnItemCli
navDrawerData = result; navDrawerData = result;
updateSelection(); // Selected item might be a feed updateSelection(); // Selected item might be a feed
navAdapter.notifyDataSetChanged(); navAdapter.notifyDataSetChanged();
progressBar.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); // Stays hidden once there is something in the list
}, error -> { }, error -> {
Log.e(TAG, Log.getStackTraceString(error)); Log.e(TAG, Log.getStackTraceString(error));
progressBar.setVisibility(View.GONE); progressBar.setVisibility(View.GONE);