diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-06-29 23:41:48 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-06-29 23:41:48 +0200 |
commit | c2a5f95da78918032a4cd71aac53d0c14f69fbef (patch) | |
tree | dab94e1acee36536be92006f8b1083d10d03a2a8 /src/main/java/de/pixart/messenger/ui/XmppActivity.java | |
parent | 5a148ad244705d4d7238903b37c3a46206df2521 (diff) |
open/close soft keyboard in quick edit
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index ca833d9c1..cd78879ac 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -78,6 +78,7 @@ import de.pixart.messenger.services.BarcodeProvider; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.services.XmppConnectionService.XmppConnectionBinder; import de.pixart.messenger.ui.util.PresenceSelector; +import de.pixart.messenger.ui.util.SoftKeyboardUtils; import de.pixart.messenger.utils.CryptoHelper; import de.pixart.messenger.utils.ExceptionHelper; import de.pixart.messenger.utils.MenuDoubleTabUtil; @@ -108,8 +109,6 @@ public abstract class XmppActivity extends ActionBarActivity { private boolean isCameraFeatureAvailable = false; - protected boolean mUseSubject = true; - protected int mTheme; protected boolean mUsingEnterKey = false; @@ -404,7 +403,6 @@ public abstract class XmppActivity extends ActionBarActivity { } mColorWhite = ContextCompat.getColor(this, R.color.white70); this.mUsingEnterKey = usingEnterKey(); - mUseSubject = getBooleanPreference("use_subject", R.bool.use_subject); } protected boolean isCameraFeatureAvailable() { @@ -445,7 +443,7 @@ public abstract class XmppActivity extends ActionBarActivity { } protected boolean usingEnterKey() { - return getPreferences().getBoolean("display_enter_key", getResources().getBoolean(R.bool.display_enter_key)); + return getBooleanPreference("display_enter_key", R.bool.display_enter_key); } protected SharedPreferences getPreferences() { @@ -456,10 +454,6 @@ public abstract class XmppActivity extends ActionBarActivity { return getPreferences().getBoolean(name, getResources().getBoolean(res)); } - public boolean useSubjectToIdentifyConference() { - return mUseSubject; - } - public void switchToConversation(Conversation conversation) { switchToConversation(conversation, null, false); } @@ -745,6 +739,7 @@ public abstract class XmppActivity extends ActionBarActivity { builder.setView(binding.getRoot()); builder.setNegativeButton(R.string.cancel, null); final AlertDialog dialog = builder.create(); + dialog.setOnShowListener(d -> SoftKeyboardUtils.showKeyboard(binding.inputEditText)); dialog.show(); View.OnClickListener clickListener = v -> { String value = binding.inputEditText.getText().toString(); @@ -755,9 +750,17 @@ public abstract class XmppActivity extends ActionBarActivity { return; } } + SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); dialog.dismiss(); }; dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(clickListener); + dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener((v -> { + SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); + dialog.dismiss(); + })); + dialog.setOnDismissListener(dialog1 -> { + SoftKeyboardUtils.hideSoftKeyboard(binding.inputEditText); + }); } protected boolean hasStoragePermission(int requestCode) { @@ -936,7 +939,7 @@ public abstract class XmppActivity extends ActionBarActivity { } protected boolean manuallyChangePresence() { - return getPreferences().getBoolean(SettingsActivity.MANUALLY_CHANGE_PRESENCE, getResources().getBoolean(R.bool.manually_change_presence)); + return getBooleanPreference(SettingsActivity.MANUALLY_CHANGE_PRESENCE, R.bool.manually_change_presence); } protected String getShareableUri() { |