mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 10:35:15 +01:00
Another ugly workaround
This commit is contained in:
@@ -25,10 +25,12 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class SelectionPredicateMessage extends SelectionTracker.SelectionPredicate<Long> {
|
||||
private boolean enabled;
|
||||
private boolean destroyed;
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
SelectionPredicateMessage(RecyclerView recyclerView) {
|
||||
this.enabled = true;
|
||||
this.destroyed = false;
|
||||
this.recyclerView = recyclerView;
|
||||
}
|
||||
|
||||
@@ -36,6 +38,10 @@ public class SelectionPredicateMessage extends SelectionTracker.SelectionPredica
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
void destroy() {
|
||||
this.destroyed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSetStateForKey(@NonNull Long key, boolean nextState) {
|
||||
if (!enabled)
|
||||
@@ -66,6 +72,6 @@ public class SelectionPredicateMessage extends SelectionTracker.SelectionPredica
|
||||
|
||||
@Override
|
||||
public boolean canSelectMultiple() {
|
||||
return true;
|
||||
return !destroyed;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user