Disable query observing when synchronising to avoid view flickering

This commit is contained in:
Shinokuni 2021-04-22 17:31:43 +02:00
parent e55dcca556
commit b7b4ae9dc4
2 changed files with 3 additions and 0 deletions

View File

@ -631,6 +631,8 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
@Override
public void onComplete() {
viewModel.invalidate();
if (viewModel.isAccountLocal() && feedNb > 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
binding.syncProgressBar.setProgress(100, true);

View File

@ -125,6 +125,7 @@ public class MainViewModel extends ViewModel {
}
public Observable<Feed> sync(List<Feed> feeds) {
itemsWithFeed.removeSource(lastFetch);
return repository.sync(feeds);
}