Accessibility: trash conversation (2)

master
M66B 1 week ago
parent eb2c113f48
commit 16bf0db5fe

@ -8152,6 +8152,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.ibTrash,
context.getString(R.string.title_trash)));
info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.ibTrashBottom,
context.getString(R.string.title_trash_conversation)));
if (properties.getSelectionCount() > 0)
info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.ibDelete,
context.getString(R.string.title_trash_selection)));
@ -8225,6 +8228,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} else if (action == R.id.ibTrash) {
onActionTrash(message, false);
return true;
} else if (action == R.id.ibTrashBottom) {
properties.select(message.id, true);
properties.moveSelection(EntityFolder.TRASH, false);
return true;
} else if (action == R.id.ibDelete) {
properties.moveSelection(EntityFolder.TRASH, false);
return true;
@ -9575,6 +9582,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int getSelectionCount();
boolean select(long id, boolean unselect);
void moveSelection(String type, boolean block);
void reply(TupleMessageEx message, CharSequence selected, View anchor);

@ -2923,6 +2923,15 @@ public class FragmentMessages extends FragmentBase
return getSelection().length;
}
@Override
public boolean select(long id, boolean unselect) {
if (selectionTracker == null)
return false;
if (unselect)
selectionTracker.clearSelection();
return selectionTracker.select(id);
}
@Override
public void moveSelection(String type, boolean block) {
onActionMoveSelection(type, block);

@ -1635,6 +1635,7 @@
<string name="title_quick_actions_clear">Clear selection after action</string>
<string name="title_trash">Trash</string>
<string name="title_trash_conversation">Trash conversation</string>
<string name="title_trash_selection">Trash selection</string>
<string name="title_copy">Copy &#8230;</string>
<string name="title_copy_to">Copy to &#8230;</string>

Loading…
Cancel
Save