Skip to content

Commit 953c31a

Browse files
authored
Merge 686df39 into 867648b
2 parents 867648b + 686df39 commit 953c31a

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- Deprecate `SentryUserFeedbackButton` (View-based and Compose-based) ([#5350](https://github.com/getsentry/sentry-java/pull/5350))
1414
- It will be removed in the next major version
1515

16+
### Fixes
17+
18+
- Fix soft input keyboard not being shown on the Feedback form ([#5359](https://github.com/getsentry/sentry-java/pull/5359))
19+
1620
### Dependencies
1721

1822
- Bump Native SDK from v0.13.7 to v0.13.8 ([#5334](https://github.com/getsentry/sentry-java/pull/5334))

sentry-android-core/src/main/java/io/sentry/android/core/SentryUserFeedbackForm.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import android.content.Context;
55
import android.os.Bundle;
66
import android.view.View;
7+
import android.view.Window;
8+
import android.view.WindowManager;
79
import android.widget.Button;
810
import android.widget.EditText;
911
import android.widget.ImageView;
@@ -55,6 +57,10 @@ public void setCancelable(boolean cancelable) {
5557
protected void onCreate(Bundle savedInstanceState) {
5658
super.onCreate(savedInstanceState);
5759
setContentView(R.layout.sentry_dialog_user_feedback);
60+
final @Nullable Window window = getWindow();
61+
if (window != null) {
62+
window.clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
63+
}
5864
setCancelable(isCancelable);
5965

6066
final @NotNull SentryFeedbackOptions feedbackOptions =

sentry-android-core/src/test/java/io/sentry/android/core/SentryUserFeedbackFormTest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.sentry.android.core
22

33
import android.content.Context
4+
import android.view.WindowManager
45
import android.widget.TextView
56
import androidx.test.core.app.ApplicationProvider
67
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -17,6 +18,7 @@ import kotlin.test.BeforeTest
1718
import kotlin.test.Test
1819
import kotlin.test.assertEquals
1920
import kotlin.test.assertNotEquals
21+
import kotlin.test.assertNotNull
2022
import org.junit.runner.RunWith
2123
import org.mockito.Mockito.mockStatic
2224
import org.mockito.kotlin.eq
@@ -130,4 +132,18 @@ class SentryUserFeedbackFormTest {
130132
// And the original options should not be modified
131133
assertNotEquals("custom title", fixture.options.feedbackOptions.formTitle)
132134
}
135+
136+
@Test
137+
fun `dialog window does not have FLAG_ALT_FOCUSABLE_IM so soft keyboard can appear`() {
138+
fixture.options.isEnabled = true
139+
val sut = fixture.getSut()
140+
sut.show()
141+
val window = sut.window
142+
assertNotNull(window)
143+
val flags = window.attributes.flags
144+
assertEquals(
145+
0,
146+
flags and WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
147+
)
148+
}
133149
}

0 commit comments

Comments
 (0)