|
|
|
@ -429,22 +429,23 @@ public class FragmentMessages extends FragmentEx {
|
|
|
|
|
selectionTracker.addObserver(new SelectionTracker.SelectionObserver() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSelectionChanged() {
|
|
|
|
|
try {
|
|
|
|
|
if (selectionTracker.hasSelection()) {
|
|
|
|
|
swipeRefresh.setEnabled(false);
|
|
|
|
|
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
|
|
|
|
if (messages != null)
|
|
|
|
|
messages.removeObservers(getViewLifecycleOwner());
|
|
|
|
|
fabMore.show();
|
|
|
|
|
} else {
|
|
|
|
|
predicate.clearAccount();
|
|
|
|
|
fabMore.hide();
|
|
|
|
|
try {
|
|
|
|
|
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
|
|
|
|
loadMessages();
|
|
|
|
|
swipeRefresh.setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
} catch (IllegalStateException ex) {
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
}
|
|
|
|
|
swipeRefresh.setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|