Skip to content

Commit 38217e6

Browse files
authored
fix: clear legacy full screen flag (#1098)
## 📜 Description Clear `FLAG_FULLSCREEN` when edge-to-edge view gets mounted. ## 💡 Motivation and Context As per documentation: > A fullscreen window will ignore a value of [SOFT_INPUT_ADJUST_RESIZE](https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_RESIZE) for the window's [softInputMode](https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode) field; the window will stay fullscreen and will not resize. [1](https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_FULLSCREEN) So if users specified somehow `FLAG_FULLSCREEN` it will ignore `SOFT_INPUT_ADJUST_RESIZE` and it will result in double animations. Edge-to-edge seems to be a new `FLAG_FULLSCREEN` alternative which gives more control over things, because you can be full screen and still show `StatusBar`. So we have a right to clear that flag when we mount `EdgeToEdge` view 😊 Closes #1091 ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### Android - clear `FLAG_FULLSCREEN` when edge-to-edge gets mounted/created. ## 🤔 How Has This Been Tested? Tested manually on Pixel 9 Pro API 31. ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<video src="https://github.com/user-attachments/assets/6a7c4b9d-725f-4415-aadd-88e36c293911">|<video src="https://github.com/user-attachments/assets/a782d868-586e-482b-9bf9-36b8cf7ecf87">| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 6c89955 commit 38217e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.content.res.Configuration
55
import android.os.Handler
66
import android.os.Looper
7+
import android.view.WindowManager
78
import android.widget.FrameLayout
89
import androidx.core.view.ViewCompat
910
import androidx.core.view.WindowCompat
@@ -153,6 +154,8 @@ class EdgeToEdgeReactViewGroup(
153154
!isEdgeToEdge,
154155
)
155156
}
157+
// unclear legacy flag if it was set earlier
158+
reactContext.currentActivity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
156159
}
157160
}
158161

0 commit comments

Comments
 (0)