Too bad it didn't fix the AndroidX crash

pull/147/head
M66B 7 years ago
parent f40d7fe7e8
commit d950157f3b

@ -476,8 +476,6 @@ public class FragmentMessages extends FragmentBase {
@Override @Override
public void onDestroy() { public void onDestroy() {
if (selectionPredicate != null)
selectionPredicate.destroy();
selectionTracker = null; selectionTracker = null;
super.onDestroy(); super.onDestroy();
} }

@ -25,12 +25,10 @@ import androidx.recyclerview.widget.RecyclerView;
public class SelectionPredicateMessage extends SelectionTracker.SelectionPredicate<Long> { public class SelectionPredicateMessage extends SelectionTracker.SelectionPredicate<Long> {
private boolean enabled; private boolean enabled;
private boolean destroyed;
private RecyclerView recyclerView; private RecyclerView recyclerView;
SelectionPredicateMessage(RecyclerView recyclerView) { SelectionPredicateMessage(RecyclerView recyclerView) {
this.enabled = true; this.enabled = true;
this.destroyed = false;
this.recyclerView = recyclerView; this.recyclerView = recyclerView;
} }
@ -38,10 +36,6 @@ public class SelectionPredicateMessage extends SelectionTracker.SelectionPredica
this.enabled = enabled; this.enabled = enabled;
} }
void destroy() {
this.destroyed = true;
}
@Override @Override
public boolean canSetStateForKey(@NonNull Long key, boolean nextState) { public boolean canSetStateForKey(@NonNull Long key, boolean nextState) {
if (!enabled) if (!enabled)
@ -72,6 +66,6 @@ public class SelectionPredicateMessage extends SelectionTracker.SelectionPredica
@Override @Override
public boolean canSelectMultiple() { public boolean canSelectMultiple() {
return !destroyed; return true;
} }
} }
Loading…
Cancel
Save