show IME emoji button when using system

Closes #4043
// FREEBIE
fork-5.53.8
Jake McGinty 2015-09-07 16:21:17 -10:00 zatwierdzone przez Moxie Marlinspike
rodzic e077cc6581
commit f95435b0f1
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -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;