testing emoji keyboard handling fix

This commit is contained in:
Arne 2024-03-05 16:38:51 +01:00
parent e703ef0298
commit 1a674a539f
4 changed files with 7 additions and 9 deletions

View file

@ -244,7 +244,7 @@
android:minWidth="336dp"
android:minHeight="480dp"
android:enableOnBackInvokedCallback="false"
android:windowSoftInputMode="adjustNothing" />
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.ScanActivity"
android:screenOrientation="portrait"

View file

@ -4759,11 +4759,11 @@ public class ConversationFragment extends XmppFragment
if (Build.VERSION.SDK_INT > 29) {
ViewCompat.setOnApplyWindowInsetsListener(activity.getWindow().getDecorView(), (v, insets) -> {
boolean isKeyboardVisible = insets.isVisible(WindowInsetsCompat.Type.ime());
int keyboardHeight = 350;
int keyboardHeight = 0;
if (activity != null && ViewConfiguration.get(activity).hasPermanentMenuKey()) {
keyboardHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom - insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - 24;
keyboardHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom - insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - 25;
} else if (activity != null) {
keyboardHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom - insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - 24;
keyboardHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom - insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom - 25;
}
if (activity != null && isKeyboardVisible && !(secondaryFragment instanceof ConversationFragment)) {
LinearLayout emojipickerview = binding.emojisStickerLayout;
@ -4803,7 +4803,7 @@ public class ConversationFragment extends XmppFragment
binding.keyboardButton.setVisibility(GONE);
binding.emojiButton.setVisibility(VISIBLE);
ViewGroup.LayoutParams params = emojipickerview.getLayoutParams();
params.height = keyboardHeight - 24;
params.height = keyboardHeight - 25;
emojipickerview.setLayoutParams(params);
binding.emojisStickerLayout.setVisibility(VISIBLE);
} else if (activity != null && keyboardOpen) {
@ -4814,8 +4814,6 @@ public class ConversationFragment extends XmppFragment
params.height = keyboardHeight - 150;
emojipickerview.setLayoutParams(params);
binding.emojisStickerLayout.setVisibility(VISIBLE);
} else if (activity != null ) {
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
}
if (activity != null && !keyboardOpen && binding.emojiButton.getVisibility() == VISIBLE) {
binding.emojisStickerLayout.setVisibility(GONE);

View file

@ -388,7 +388,7 @@
<LinearLayout
android:id="@+id/emojis_sticker_layout"
android:layout_width="match_parent"
android:layout_height="190dp"
android:layout_height="0dp"
android:layout_below="@+id/textformat"
android:orientation="vertical"
android:visibility="gone"

View file

@ -377,7 +377,7 @@
<LinearLayout
android:id="@+id/emojis_sticker_layout"
android:layout_width="match_parent"
android:layout_height="270dp"
android:layout_height="0dp"
android:layout_below="@+id/textformat"
android:orientation="vertical"
android:visibility="gone"