diff --git a/vector/src/main/java/im/vector/activity/VectorRoomActivity.java b/vector/src/main/java/im/vector/activity/VectorRoomActivity.java index 9079d62b9c..2f08bb076b 100755 --- a/vector/src/main/java/im/vector/activity/VectorRoomActivity.java +++ b/vector/src/main/java/im/vector/activity/VectorRoomActivity.java @@ -1684,6 +1684,15 @@ private void appendInTextEditor(String text) { } } + /** + * Init the edited with a provided text + * @param text the text + */ + public void initEditText(String text) { + mEditText.setText(""); + mEditText.append(text); + } + //================================================================================ // Notifications area management (... is typing and so on) //================================================================================ diff --git a/vector/src/main/java/im/vector/fragments/VectorMessageListFragment.java b/vector/src/main/java/im/vector/fragments/VectorMessageListFragment.java index 6cfee122e5..550e35f57b 100755 --- a/vector/src/main/java/im/vector/fragments/VectorMessageListFragment.java +++ b/vector/src/main/java/im/vector/fragments/VectorMessageListFragment.java @@ -300,7 +300,14 @@ public void onClick(DialogInterface dialog, int which) { .show(); } }); - } else if ((action == R.id.ic_action_vector_quote) || (action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_save)) { + } else if (action == R.id.ic_action_vector_quote) { + Activity attachedActivity = getActivity(); + + if ((null != attachedActivity) && (attachedActivity instanceof VectorRoomActivity)) { + Message message = JsonUtils.toMessage(event.content); + ((VectorRoomActivity)attachedActivity).initEditText( "> " + message.body + "\n\n"); + } + } else if ((action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_save)) { // Message message = JsonUtils.toMessage(event.content); @@ -335,11 +342,7 @@ public void onClick(DialogInterface dialog, int which) { final Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); - if (action == R.id.ic_action_vector_quote) { - sendIntent.putExtra(Intent.EXTRA_TEXT, "> " + message.body); - } else { - sendIntent.putExtra(Intent.EXTRA_TEXT, message.body); - } + sendIntent.putExtra(Intent.EXTRA_TEXT, message.body); sendIntent.setType("text/plain"); if ((action == R.id.ic_action_vector_forward) ||(action == R.id.ic_action_vector_quote)) {