Fix unresponsive button on image send with text in landscape.

Fixes #8575
Closes #8638

Co-authored-by: Jakub Gregorek <jg@inthemeadow.net>
This commit is contained in:
Alan Evans 2019-04-08 07:45:16 -03:00 committed by GitHub
parent 6d111e5f68
commit ecdc285378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.TextView; import android.widget.TextView;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
@ -211,6 +212,11 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
.or(Optional.fromNullable(recipient.getProfileName()) .or(Optional.fromNullable(recipient.getProfileName())
.or(recipient.getAddress().serialize())); .or(recipient.getAddress().serialize()));
composeText.setHint(getString(R.string.MediaSendActivity_message_to_s, displayName), null); composeText.setHint(getString(R.string.MediaSendActivity_message_to_s, displayName), null);
composeText.setOnEditorActionListener((v, actionId, event) -> {
boolean isSend = actionId == EditorInfo.IME_ACTION_SEND;
if (isSend) sendButton.performClick();
return isSend;
});
if (TextSecurePreferences.isSystemEmojiPreferred(getContext())) { if (TextSecurePreferences.isSystemEmojiPreferred(getContext())) {
emojiToggle.setVisibility(View.GONE); emojiToggle.setVisibility(View.GONE);