Commit 892510c5 authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer: send action text insert fixed.

parent abcde7d2
......@@ -62,6 +62,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
private boolean exitOnSend;
private String extraText = null;
ChatViewerAdapter chatViewerAdapter;
ViewPager viewPager;
......@@ -132,8 +134,9 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
Intent intent = getIntent();
if (Intent.ACTION_SEND.equals(intent.getAction())) {
String additional = intent.getStringExtra(Intent.EXTRA_TEXT);
if (additional != null) {
extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
if (extraText != null) {
intent.removeExtra(Intent.EXTRA_TEXT);
exitOnSend = true;
}
......@@ -354,6 +357,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
for (CurrentUpdatableChat chat : registeredChats) {
if (chat.isEqual(actionWithAccount, actionWithUser)) {
chat.setInputFocus();
if (extraText != null) {
chat.setInputText(extraText);
extraText = null;
}
}
}
}
......@@ -362,5 +370,6 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
public void updateChat(final boolean incoming);
public boolean isEqual(String account, String user);
public void setInputFocus();
public void setInputText(String text);
}
}
......@@ -571,7 +571,7 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
*
* @param additional
*/
public void insertText(String additional) {
private void insertText(String additional) {
String source = inputView.getText().toString();
int selection = inputView.getSelectionEnd();
if (selection == -1)
......@@ -605,4 +605,9 @@ public class ChatViewerFragment extends Fragment implements ChatViewer.CurrentUp
public void setInputFocus() {
inputView.requestFocus();
}
@Override
public void setInputText(String text) {
insertText(text);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment