Skip to content
TypeScript

fix(mobile): keep the collapsed Android rail square (#26039)

Alex2ba1a09dcb92
diff --git a/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt b/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
index d1edfecb3e5..32969b1b715 100644
--- a/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
+++ b/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
@@ -284,6 +284,7 @@ class T3WorkspaceNavigationView(
},
) {
val fraction = progress.coerceIn(0f, 1f)
+ val railShape = RoundedCornerShape(topEnd = 16.dp * fraction, bottomEnd = 16.dp * fraction)
if (fraction > 0f) {
Scrim(
contentDescription = "Close navigation rail",
@@ -295,8 +296,8 @@ class T3WorkspaceNavigationView(
Modifier
.fillMaxHeight()
.width(lerp(RAIL_WIDTH, EXPANDED_RAIL_WIDTH, progress.coerceAtLeast(0f)))
- .shadow(RAIL_SHADOW * fraction, RAIL_EXPANDED_SHAPE, clip = false)
- .background(Color(containerColor), RAIL_EXPANDED_SHAPE)
+ .shadow(RAIL_SHADOW * fraction, railShape, clip = false)
+ .background(Color(containerColor), railShape)
.padding(top = safeAreaTop.dp, bottom = safeAreaBottom.dp + 12.dp)
.selectableGroup(),
) {
@@ -437,7 +438,6 @@ class T3WorkspaceNavigationView(
val FAB_SIZE = 48.dp
val ICON_SIZE = 24.dp
val RAIL_SHADOW = 6.dp
- val RAIL_EXPANDED_SHAPE = RoundedCornerShape(topEnd = 16.dp, bottomEnd = 16.dp)
const val DISABLED_ALPHA = 0.4f
// Labels fade in over the second half of the widening, once there is room for them, and