mirror of https://github.com/M66B/FairEmail.git
Remove selection tracker workaround
This commit is contained in:
parent
1ebf77edd1
commit
7e7eb8a8ae
|
@ -441,24 +441,12 @@ public class FragmentMessages extends FragmentBase {
|
|||
@Override
|
||||
public void onSelectionChanged() {
|
||||
SelectionTracker tracker = selectionTracker;
|
||||
if (tracker == null)
|
||||
if (tracker == null) // destroyed
|
||||
return;
|
||||
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null) {
|
||||
try {
|
||||
ViewModelMessages modelMessages = ViewModelProviders.of(activity).get(ViewModelMessages.class);
|
||||
if (tracker.hasSelection())
|
||||
modelMessages.removeObservers(viewType, getViewLifecycleOwner());
|
||||
else
|
||||
modelMessages.observe(viewType, getViewLifecycleOwner(), observer);
|
||||
} catch (IllegalStateException ex) {
|
||||
// getViewLifecycleOwner
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
if (activity != null)
|
||||
activity.invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
if (tracker.hasSelection()) {
|
||||
swipeRefresh.setEnabled(false);
|
||||
|
|
Loading…
Reference in New Issue