Clear message field after sharing

After the Android sharing functionality was used, the shared text sticks
in the message composing field in the conversation. Also if an text was
forwared to the same conversation the text which was shared before
sticks in the message composing field.

Now the message composing field is empty after sharing or forwarding
something.

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2021-09-29 12:13:38 +02:00
parent f185ede417
commit cf471e336f
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -199,14 +199,13 @@ public class ConversationsListController extends BaseController implements Searc
private Bundle conversationMenuBundle = null; private Bundle conversationMenuBundle = null;
private boolean showShareToScreen = false; private boolean showShareToScreen = false;
private boolean shareToScreenWasShown = false;
private ArrayList<String> filesToShare; private ArrayList<String> filesToShare;
private Conversation selectedConversation; private Conversation selectedConversation;
private String textToPaste = ""; private String textToPaste = "";
private boolean forwardMessage = false; private boolean forwardMessage;
private SmoothScrollLinearLayoutManager layoutManager; private SmoothScrollLinearLayoutManager layoutManager;
@ -347,7 +346,7 @@ public class ConversationsListController extends BaseController implements Searc
searchView = (SearchView) MenuItemCompat.getActionView(searchItem); searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
showShareToScreen = !shareToScreenWasShown && hasActivityActionSendIntent(); showShareToScreen = !showShareToScreen && hasActivityActionSendIntent();
if (showShareToScreen) { if (showShareToScreen) {
@ -786,10 +785,11 @@ public class ConversationsListController extends BaseController implements Searc
selectedConversation = getConversation(position); selectedConversation = getConversation(position);
if (selectedConversation != null && getActivity() != null) { if (selectedConversation != null && getActivity() != null) {
if (showShareToScreen) { if (showShareToScreen) {
shareToScreenWasShown = true;
handleSharedData(); handleSharedData();
showShareToScreen = false;
} else if (forwardMessage) { } else if (forwardMessage) {
openConversation(bundle.getString(BundleKeys.INSTANCE.getKEY_FORWARD_MSG_TEXT())); openConversation(bundle.getString(BundleKeys.INSTANCE.getKEY_FORWARD_MSG_TEXT()));
forwardMessage = false;
} else { } else {
openConversation(); openConversation();
} }