fix(mobile): preserve Android tab ripples during appearance updates
This commit is contained in:
4 files changed
+49
-12
No files matched your search
@@ -116,7 +116,7 @@ function TabsContent() {
|
||||
tintColor={tabColors.tintColor}
|
||||
minimizeBehavior="onScrollDown"
|
||||
{...(Platform.OS === "android"
|
||||
? { disableIndicator: true, rippleColor: "transparent" }
|
||||
? { disableIndicator: true, rippleColor: tabColors.tintColor }
|
||||
: {})}
|
||||
>
|
||||
{Platform.OS === "ios" && showBottomAccessory ? (
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
"packageManager": "pnpm@10.1.0",
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"expo-audio@58.0.10": "patches/expo-audio@58.0.10.patch"
|
||||
"expo-audio@58.0.10": "patches/expo-audio@58.0.10.patch",
|
||||
"react-native-screens@4.30.0": "patches/react-native-screens@4.30.0.patch"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
diff --git a/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/appearance/TabsAppearanceApplicator.kt b/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/appearance/TabsAppearanceApplicator.kt
|
||||
index cbe9b978ced6972a51bc5235b47a58dd55836351..b7063502332a7d1da5cb58ea8738670a9d3f5e87 100644
|
||||
--- a/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/appearance/TabsAppearanceApplicator.kt
|
||||
+++ b/android/src/main/java/com/swmansion/rnscreens/gamma/tabs/appearance/TabsAppearanceApplicator.kt
|
||||
@@ -186,16 +186,24 @@ internal class TabsAppearanceApplicator(
|
||||
val rippleColor =
|
||||
tabBarAppearance?.tabBarItemRippleColor
|
||||
?: resolveColorAttr(context, R.attr.itemRippleColor)
|
||||
- bottomNavigationView.itemRippleColor = ColorStateList.valueOf(rippleColor)
|
||||
+ // Material recreates the ripple drawable on these setters, even when
|
||||
+ // values are unchanged. Preserve an in-flight press across tab updates.
|
||||
+ if (bottomNavigationView.itemRippleColor?.defaultColor != rippleColor) {
|
||||
+ bottomNavigationView.itemRippleColor = ColorStateList.valueOf(rippleColor)
|
||||
+ }
|
||||
|
||||
// Active Indicator
|
||||
val activeIndicatorColor =
|
||||
tabBarAppearance?.tabBarItemActiveIndicatorColor
|
||||
?: resolveColorAttr(context, R.attr.colorSecondaryContainer)
|
||||
|
||||
- bottomNavigationView.isItemActiveIndicatorEnabled =
|
||||
- tabBarAppearance?.tabBarItemActiveIndicatorEnabled ?: true
|
||||
- bottomNavigationView.itemActiveIndicatorColor = ColorStateList.valueOf(activeIndicatorColor)
|
||||
+ val activeIndicatorEnabled = tabBarAppearance?.tabBarItemActiveIndicatorEnabled ?: true
|
||||
+ if (bottomNavigationView.isItemActiveIndicatorEnabled != activeIndicatorEnabled) {
|
||||
+ bottomNavigationView.isItemActiveIndicatorEnabled = activeIndicatorEnabled
|
||||
+ }
|
||||
+ if (bottomNavigationView.itemActiveIndicatorColor?.defaultColor != activeIndicatorColor) {
|
||||
+ bottomNavigationView.itemActiveIndicatorColor = ColorStateList.valueOf(activeIndicatorColor)
|
||||
+ }
|
||||
}
|
||||
|
||||
fun updateFontStyles(
|
||||
Generated
+13
-10
@@ -8,6 +8,9 @@ patchedDependencies:
|
||||
expo-audio@58.0.10:
|
||||
hash: f7f102c0f17b28e763d828acd4f138d62809f5be576e316a13008c27e84968c5
|
||||
path: patches/expo-audio@58.0.10.patch
|
||||
react-native-screens@4.30.0:
|
||||
hash: 4c993bb49116c59c1df018c02687484d61964af674b5ea2d5b68c051e434423a
|
||||
path: patches/react-native-screens@4.30.0.patch
|
||||
|
||||
importers:
|
||||
|
||||
@@ -93,7 +96,7 @@ importers:
|
||||
version: 58.0.4(expo@58.0.17)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
expo-router:
|
||||
specifier: ~58.0.25
|
||||
version: 58.0.25(114ad080e17b889d99a70734d72d1fb4)
|
||||
version: 58.0.25(5c865dc62adb071be8c7946ff2c6115b)
|
||||
expo-secure-store:
|
||||
specifier: ~58.0.2
|
||||
version: 58.0.2(expo@58.0.17)
|
||||
@@ -135,7 +138,7 @@ importers:
|
||||
version: 5.10.1(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-screens:
|
||||
specifier: 4.30.0
|
||||
version: 4.30.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
version: 4.30.0(patch_hash=4c993bb49116c59c1df018c02687484d61964af674b5ea2d5b68c051e434423a)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-svg:
|
||||
specifier: 15.16.0
|
||||
version: 15.16.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
@@ -144,7 +147,7 @@ importers:
|
||||
version: 0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
sonner-native:
|
||||
specifier: ^0.26.2
|
||||
version: 0.26.4(6b7420e058a3b6d4e4d2699d79ac8702)
|
||||
version: 0.26.4(ee6658a01f0566316b5a28dccc2b8480)
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^20
|
||||
@@ -7528,7 +7531,7 @@ snapshots:
|
||||
ws: 8.21.0
|
||||
zod: 3.25.76
|
||||
optionalDependencies:
|
||||
expo-router: 58.0.25(114ad080e17b889d99a70734d72d1fb4)
|
||||
expo-router: 58.0.25(5c865dc62adb071be8c7946ff2c6115b)
|
||||
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0)
|
||||
transitivePeerDependencies:
|
||||
- '@expo/dom-webview'
|
||||
@@ -7829,7 +7832,7 @@ snapshots:
|
||||
react: 19.3.0
|
||||
optionalDependencies:
|
||||
'@expo/metro-runtime': 58.0.15(@expo/log-box@58.0.13)(expo@58.0.17)(react-dom@19.3.0(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
expo-router: 58.0.25(114ad080e17b889d99a70734d72d1fb4)
|
||||
expo-router: 58.0.25(5c865dc62adb071be8c7946ff2c6115b)
|
||||
react-dom: 19.3.0(react@19.3.0)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@@ -11230,7 +11233,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
expo-router@58.0.25(114ad080e17b889d99a70734d72d1fb4):
|
||||
expo-router@58.0.25(5c865dc62adb071be8c7946ff2c6115b):
|
||||
dependencies:
|
||||
'@expo/log-box': 58.0.13(@expo/dom-webview@58.0.2)(expo@58.0.17)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
'@expo/metro-runtime': 58.0.15(@expo/log-box@58.0.13)(expo@58.0.17)(react-dom@19.3.0(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
@@ -11252,7 +11255,7 @@ snapshots:
|
||||
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0)
|
||||
react-native-drawer-layout: 4.2.12(react-native-gesture-handler@3.3.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0))(react-native-reanimated@4.7.1(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-safe-area-context: 5.10.1(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-screens: 4.30.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-screens: 4.30.0(patch_hash=4c993bb49116c59c1df018c02687484d61964af674b5ea2d5b68c051e434423a)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
server-only: 0.0.1
|
||||
sf-symbols-typescript: 2.2.0
|
||||
standard-navigation: 0.0.5
|
||||
@@ -12954,7 +12957,7 @@ snapshots:
|
||||
react: 19.3.0
|
||||
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0)
|
||||
|
||||
react-native-screens@4.30.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0):
|
||||
react-native-screens@4.30.0(patch_hash=4c993bb49116c59c1df018c02687484d61964af674b5ea2d5b68c051e434423a)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0):
|
||||
dependencies:
|
||||
react: 19.3.0
|
||||
react-freeze: 1.0.4(react@19.3.0)
|
||||
@@ -13503,14 +13506,14 @@ snapshots:
|
||||
|
||||
slugify@1.6.9: {}
|
||||
|
||||
sonner-native@0.26.4(6b7420e058a3b6d4e4d2699d79ac8702):
|
||||
sonner-native@0.26.4(ee6658a01f0566316b5a28dccc2b8480):
|
||||
dependencies:
|
||||
react: 19.3.0
|
||||
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0)
|
||||
react-native-gesture-handler: 3.3.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-reanimated: 4.7.1(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-safe-area-context: 5.10.1(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-screens: 4.30.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-screens: 4.30.0(patch_hash=4c993bb49116c59c1df018c02687484d61964af674b5ea2d5b68c051e434423a)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-svg: 15.16.0(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
react-native-worklets: 0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7))(@types/react@19.3.0)(react@19.3.0))(react@19.3.0)
|
||||
|
||||
|
||||
Reference in new issue
Block a user