Remove selection tracker workaround

pull/147/head
M66B 6 years ago
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…
Cancel
Save