-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: react on
StatusBar.translucent
changes (#528)
## 📜 Description Give an ability to control `translucent` from `StatusBar` component. ## 💡 Motivation and Context The original decision to ignore `translucent` property was introduced in #30 The problem is that we already have `translucent` `StatusBar` and we can only mimicrate `non-translucent` by adding additional margin. The solution with static `statusBarTranslucent` property was added #15 and till now we didn't have an ability to manage `translucent` property dynamically The new functionality was requested in #526 To implement new functionality I am discovering `edge-to-edge` view (managed by `KeyboardProvider`) and conditionally add remove padding, re-setup listener and re-request insets update. Closes #526 ## 📢 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 --> ### JS - add `vendor` to prettier ignore; - add `StatusBar` to root screen; - add new dynamic props to StatusBar example (`translucent`) + module management; - add testID to StatusBar example screen; ### E2E - updated assets on Android; ### Android - added new `ReactContext` extension file and move `.rootView` and `.content` extensions there; - implemented `setTranslucent` method in `StatusBarCompatModule`; - assign `TAG` to `EdgeToEdgeView`; ## 🤔 How Has This Been Tested? Tested manually on: - Pixel 3a (API 33, emulator); - Pixel 7 Pro (API 34, real device); - (Xiaomi Redmi Note 5 Pro, API 28); ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<video src="https://github.com/user-attachments/assets/e2b5e28f-6038-4d09-8c9e-2ef7d5015395">|<video src="https://github.com/user-attachments/assets/e089f3a4-f2bd-4e4a-9d32-0804c88ed2f4">| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
- Loading branch information
1 parent
1bce3c8
commit 265b93c
Showing
66 changed files
with
85 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ docs/.docusaurus/ | |
docs/build/ | ||
lib/ | ||
node_modules/ | ||
vendor/ | ||
|
||
*.lottie.json | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
android/src/main/java/com/reactnativekeyboardcontroller/extensions/ReactContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.reactnativekeyboardcontroller.extensions | ||
|
||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.facebook.react.bridge.ReactContext | ||
|
||
val ReactContext.rootView: View? | ||
get() = this.currentActivity?.window?.decorView?.rootView | ||
|
||
val ReactContext.content: ViewGroup? | ||
get() = this.currentActivity?.window?.decorView?.rootView?.findViewById( | ||
androidx.appcompat.R.id.action_bar_root, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.22 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewPackagePaddingClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.21 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewPackagePaddingInitial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.24 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewPackagePaddingOpened.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.32 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewRNPaddingClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.25 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewRNPaddingInitial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.3 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AvoidingViewRNPaddingOpened.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.98 KB
(100%)
...t/assets/android/e2e_emulator_28/AwareScrollViewDisabledStateKeyboardClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.09 KB
(100%)
...t/assets/android/e2e_emulator_28/AwareScrollViewDisabledStateKeyboardOpened.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.09 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewFirstInputFocused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.16 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewFirstInputGrown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.9 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewInputChanged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.02 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewKeyboardClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.98 KB
(100%)
...sets/android/e2e_emulator_28/AwareScrollViewKeyboardClosedWithoutBackScroll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.09 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewSecondInputFocused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.8 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewTextChanged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.14 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/AwareScrollViewTextSelectionChanged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.3 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/DisabledKeyboardIsHidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.13 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/DisabledKeyboardIsShown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.32 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/EnabledKeyboardIsHidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.2 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/EnabledKeyboardIsShown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.24 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/InteractiveKeyboardAfterGestureDown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.21 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/InteractiveKeyboardAfterGestureUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.24 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/InteractiveKeyboardIsShown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.1 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/KeyboardAnimationKeyboardIsHidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.92 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/KeyboardAnimationKeyboardIsShown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.36 KB
(110%)
e2e/kit/assets/android/e2e_emulator_28/ModalKeyboardClosed.png
Oops, something went wrong.
Binary file modified
BIN
+2.06 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/ModalKeyboardOpened.png
Oops, something went wrong.
Binary file modified
BIN
+2.1 KB
(100%)
e2e/kit/assets/android/e2e_emulator_28/ToolbarKeyboardClosed.png
Oops, something went wrong.
Binary file modified
BIN
+2.06 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewPackagePaddingClosed.png
Oops, something went wrong.
Binary file modified
BIN
+2.06 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewPackagePaddingInitial.png
Oops, something went wrong.
Binary file modified
BIN
+1.99 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewPackagePaddingOpened.png
Oops, something went wrong.
Binary file modified
BIN
+2.12 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewRNPaddingClosed.png
Oops, something went wrong.
Binary file modified
BIN
+2.08 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewRNPaddingInitial.png
Oops, something went wrong.
Binary file modified
BIN
+2.2 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AvoidingViewRNPaddingOpened.png
Oops, something went wrong.
Binary file modified
BIN
+1.42 KB
(100%)
...t/assets/android/e2e_emulator_31/AwareScrollViewDisabledStateKeyboardClosed.png
Oops, something went wrong.
Binary file modified
BIN
+1.53 KB
(100%)
...t/assets/android/e2e_emulator_31/AwareScrollViewDisabledStateKeyboardOpened.png
Oops, something went wrong.
Binary file modified
BIN
+1.7 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewFirstInputFocused.png
Oops, something went wrong.
Binary file modified
BIN
+1.79 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewFirstInputGrown.png
Oops, something went wrong.
Binary file modified
BIN
+726 Bytes
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewInputChanged.png
Oops, something went wrong.
Binary file modified
BIN
+1.84 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewKeyboardClosed.png
Oops, something went wrong.
Binary file modified
BIN
+1.42 KB
(100%)
...sets/android/e2e_emulator_31/AwareScrollViewKeyboardClosedWithoutBackScroll.png
Oops, something went wrong.
Binary file modified
BIN
+1.52 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewSecondInputFocused.png
Oops, something went wrong.
Binary file modified
BIN
+1.74 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewTextChanged.png
Oops, something went wrong.
Binary file modified
BIN
+583 Bytes
(100%)
e2e/kit/assets/android/e2e_emulator_31/AwareScrollViewTextSelectionChanged.png
Oops, something went wrong.
Binary file modified
BIN
+2.21 KB
(110%)
e2e/kit/assets/android/e2e_emulator_31/DisabledKeyboardIsHidden.png
Oops, something went wrong.
Binary file modified
BIN
+2.4 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/DisabledKeyboardIsShown.png
Oops, something went wrong.
Binary file modified
BIN
+2.27 KB
(110%)
e2e/kit/assets/android/e2e_emulator_31/EnabledKeyboardIsHidden.png
Oops, something went wrong.
Binary file modified
BIN
+2.41 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/EnabledKeyboardIsShown.png
Oops, something went wrong.
Binary file modified
BIN
+2.1 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/InteractiveKeyboardAfterGestureDown.png
Oops, something went wrong.
Binary file modified
BIN
+1.99 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/InteractiveKeyboardAfterGestureUp.png
Oops, something went wrong.
Binary file modified
BIN
+1.99 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/InteractiveKeyboardIsShown.png
Oops, something went wrong.
Binary file modified
BIN
+2.01 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/KeyboardAnimationEmojiKeyboard.png
Oops, something went wrong.
Binary file modified
BIN
+1.95 KB
(110%)
e2e/kit/assets/android/e2e_emulator_31/KeyboardAnimationKeyboardIsHidden.png
Oops, something went wrong.
Binary file modified
BIN
+1.95 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/KeyboardAnimationKeyboardIsShown.png
Oops, something went wrong.
Binary file modified
BIN
+1.99 KB
(110%)
e2e/kit/assets/android/e2e_emulator_31/ModalKeyboardClosed.png
Oops, something went wrong.
Binary file modified
BIN
+2.25 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/ModalKeyboardOpened.png
Oops, something went wrong.
Binary file modified
BIN
+2.01 KB
(100%)
e2e/kit/assets/android/e2e_emulator_31/ToolbarKeyboardClosed.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters