Skip to content

Commit 2ba1a09

Browse files
authored
fix(mobile): keep the collapsed Android rail square (#26039)
1 parent 5b15cfc commit 2ba1a09

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ class T3WorkspaceNavigationView(
284284
},
285285
) {
286286
val fraction = progress.coerceIn(0f, 1f)
287+
val railShape = RoundedCornerShape(topEnd = 16.dp * fraction, bottomEnd = 16.dp * fraction)
287288
if (fraction > 0f) {
288289
Scrim(
289290
contentDescription = "Close navigation rail",
@@ -295,8 +296,8 @@ class T3WorkspaceNavigationView(
295296
Modifier
296297
.fillMaxHeight()
297298
.width(lerp(RAIL_WIDTH, EXPANDED_RAIL_WIDTH, progress.coerceAtLeast(0f)))
298-
.shadow(RAIL_SHADOW * fraction, RAIL_EXPANDED_SHAPE, clip = false)
299-
.background(Color(containerColor), RAIL_EXPANDED_SHAPE)
299+
.shadow(RAIL_SHADOW * fraction, railShape, clip = false)
300+
.background(Color(containerColor), railShape)
300301
.padding(top = safeAreaTop.dp, bottom = safeAreaBottom.dp + 12.dp)
301302
.selectableGroup(),
302303
) {
@@ -437,7 +438,6 @@ class T3WorkspaceNavigationView(
437438
val FAB_SIZE = 48.dp
438439
val ICON_SIZE = 24.dp
439440
val RAIL_SHADOW = 6.dp
440-
val RAIL_EXPANDED_SHAPE = RoundedCornerShape(topEnd = 16.dp, bottomEnd = 16.dp)
441441
const val DISABLED_ALPHA = 0.4f
442442

443443
// Labels fade in over the second half of the widening, once there is room for them, and

0 commit comments

Comments
 (0)