aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/widget
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-12-25 21:11:20 +0100
committerChristian Schneppe <christian@pix-art.de>2016-12-25 21:11:20 +0100
commit1924cfbd53b371c6c0e5f7b5fa719ec62ed9aac6 (patch)
treeed95ad768802027c48476b141be9080bb295197f /src/main/java/de/pixart/messenger/ui/widget
parent37aedc49f36041abc7f35132e13241c26338ba99 (diff)
support for quoting messages
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/widget')
-rw-r--r--src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
index 487cf3a0a..7ccf94dbe 100644
--- a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
+++ b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
@@ -69,8 +69,8 @@ public class ListSelectionManager {
private int futureSelectionStart;
private int futureSelectionEnd;
- public void onCreate(TextView textView) {
- final CustomCallback callback = new CustomCallback(textView);
+ public void onCreate(TextView textView, ActionMode.Callback additionalCallback) {
+ final CustomCallback callback = new CustomCallback(textView, additionalCallback);
textView.setCustomSelectionActionModeCallback(callback);
}
@@ -112,10 +112,12 @@ public class ListSelectionManager {
private class CustomCallback implements ActionMode.Callback {
private final TextView textView;
+ private final ActionMode.Callback additionalCallback;
public Object identifier;
- public CustomCallback(TextView textView) {
+ public CustomCallback(TextView textView, ActionMode.Callback additionalCallback) {
this.textView = textView;
+ this.additionalCallback = additionalCallback;
}
@Override
@@ -123,21 +125,33 @@ public class ListSelectionManager {
selectionActionMode = mode;
selectionIdentifier = identifier;
selectionTextView = textView;
+ if (additionalCallback != null) {
+ additionalCallback.onCreateActionMode(mode, menu);
+ }
return true;
}
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+ if (additionalCallback != null) {
+ additionalCallback.onPrepareActionMode(mode, menu);
+ }
return true;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+ if (additionalCallback != null && additionalCallback.onActionItemClicked(mode, item)) {
+ return true;
+ }
return false;
}
@Override
public void onDestroyActionMode(ActionMode mode) {
+ if (additionalCallback != null) {
+ additionalCallback.onDestroyActionMode(mode);
+ }
if (selectionActionMode == mode) {
selectionActionMode = null;
selectionIdentifier = null;