show IME emoji button when using system

Closes #4043
// FREEBIE
This commit is contained in:
Jake McGinty 2015-09-07 16:21:17 -10:00 committed by Moxie Marlinspike
parent e077cc6581
commit f95435b0f1

View File

@ -64,7 +64,8 @@ public class ComposeText extends EmojiEditText {
}
public void setTransport(TransportOption transport) {
final boolean enterSends = TextSecurePreferences.isEnterSendsEnabled(getContext());
final boolean enterSends = TextSecurePreferences.isEnterSendsEnabled(getContext());
final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());
int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
int inputType = getInputType();
@ -72,6 +73,10 @@ public class ComposeText extends EmojiEditText {
if (isLandscape()) setImeActionLabel(transport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
else setImeActionLabel(null, 0);
if (useSystemEmoji) {
inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
}
inputType = !isLandscape() && enterSends
? inputType & ~InputType.TYPE_TEXT_FLAG_MULTI_LINE
: inputType | InputType.TYPE_TEXT_FLAG_MULTI_LINE;