Skip to content

Instantly share code, notes, and snippets.

@yareally
Last active August 29, 2015 14:02
Show Gist options
  • Save yareally/604f58097a47e2ccb1dc to your computer and use it in GitHub Desktop.
Save yareally/604f58097a47e2ccb1dc to your computer and use it in GitHub Desktop.
fixes the send button
// original code:
private void initializeIme() {
if (TextSecurePreferences.isEnterImeKeyEnabled(this)) {
composeText.setInputType(composeText.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
} else {
composeText.setInputType(composeText.getInputType() | (InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
}
}
// new code
private void initializeIme() {
// TODO: fix so it only minimally mods the xml and this function (if possible)
composeText.setHorizontallyScrolling(false);
composeText.setMaxLines(4);
if (TextSecurePreferences.isEnterImeKeyEnabled(this)) {
if (TextSecurePreferences.isEnterSendsEnabled(this)) {
composeText.setInputType(composeText.getInputType());
} else {
composeText.setImeOptions(~EditorInfo.IME_ACTION_SEND);
composeText.setInputType(composeText.getInputType() | (InputType.TYPE_TEXT_FLAG_MULTI_LINE));
}
} else {
composeText.setInputType((composeText.getInputType()) | (InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment