Skip to content

Commit ba74721

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-26051
2 parents f94ad3b + d0b81ce commit ba74721

18 files changed

Lines changed: 611 additions & 323 deletions
-771 KB
Binary file not shown.
774 KB
Binary file not shown.

‎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

‎apps/mobile/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"react-native-pdf-jsi": "5.0.0",
128128
"react-native-reanimated": "4.7.1",
129129
"react-native-safe-area-context": "~5.10.1",
130-
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.45.tgz",
130+
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.48.tgz",
131131
"react-native-svg": "15.16.0",
132132
"react-native-webview": "14.0.1",
133133
"react-native-worklets": "0.13.0",

‎apps/mobile/src/components/ui/AndroidScreenHeader.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AppActivityIndicator } from "./AppActivityIndicator";
22
import { Column, Row, Text as NativeText, RNHostView } from "@expo/ui/jetpack-compose";
33
import { weight } from "@expo/ui/jetpack-compose/modifiers";
4-
import { useState, type ReactNode } from "react";
4+
import { use, useState, type ReactNode } from "react";
55
import { View } from "react-native";
66

77
import type { AppSymbolName } from "./AppSymbol";
@@ -12,6 +12,7 @@ import { splitAndroidHeaderActions } from "./headerMenu.android";
1212
import { useScaledTextRole } from "../../features/settings/appearance/useScaledTextRole";
1313
import { useToolbarLayout } from "./useToolbarLayout";
1414
import { useControlTheme } from "./useControlTheme";
15+
import { RoutedFormSheetContext } from "./RoutedFormSheetContext";
1516

1617
export interface AndroidHeaderAction {
1718
readonly accessibilityLabel: string;
@@ -50,7 +51,8 @@ export function AndroidScreenHeader(props: {
5051
const { colors } = useControlTheme();
5152
const titleTypography = useScaledTextRole("title");
5253
const subtitleTypography = useScaledTextRole("label");
53-
const { paddingTop, paddingBottom } = useToolbarLayout(props.embedded);
54+
const inFormSheet = use(RoutedFormSheetContext);
55+
const { paddingTop, paddingBottom } = useToolbarLayout(props.embedded || inFormSheet);
5456
const [headerWidth, setHeaderWidth] = useState(0);
5557
const { visibleActions, overflowActions } = splitAndroidHeaderActions(
5658
props.actions ?? [],
@@ -67,6 +69,12 @@ export function AndroidScreenHeader(props: {
6769
borderBottomWidth: props.hideBottomBorder ? 0 : undefined,
6870
}}
6971
>
72+
{inFormSheet ? (
73+
<View
74+
pointerEvents="none"
75+
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
76+
/>
77+
) : null}
7078
<NativeAppBar
7179
singleLine={props.compact}
7280
navigationIcon={
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createContext } from "react";
2+
3+
export const RoutedFormSheetContext = createContext(false);

‎apps/mobile/src/components/ui/Sheet.android.tsx‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { View } from "react-native";
33
import { FormSheet } from "react-native-screens";
44
import { useResolveClassNames } from "uniwind";
55
import { AndroidSheetHeader } from "./AndroidScreenHeader";
6+
import { RoutedFormSheetContext } from "./RoutedFormSheetContext";
67
import { ScreenContent } from "./ScreenContent";
78
import type { SheetProps } from "./Sheet.types";
89
export type { SheetProps } from "./Sheet.types";
@@ -19,15 +20,21 @@ export function Sheet(props: SheetProps) {
1920
onDismiss={props.onClose}
2021
onNativeDismiss={props.onClose}
2122
>
22-
{/* Android FormSheet does not bound flex children. Material drags target the first scroll view, so place content before the header. */}
23-
<View collapsable={false} className="absolute inset-0 flex-col-reverse bg-header">
24-
<ScreenContent>{props.children}</ScreenContent>
25-
<AndroidSheetHeader title={props.title} onBack={() => setIsOpen(false)} hideBottomBorder />
26-
<View
27-
pointerEvents="none"
28-
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
29-
/>
30-
</View>
23+
<RoutedFormSheetContext value={false}>
24+
{/* Android FormSheet does not bound flex children. Material drags target the first scroll view, so place content before the header. */}
25+
<View collapsable={false} className="absolute inset-0 flex-col-reverse bg-header">
26+
<ScreenContent>{props.children}</ScreenContent>
27+
<AndroidSheetHeader
28+
title={props.title}
29+
onBack={() => setIsOpen(false)}
30+
hideBottomBorder
31+
/>
32+
<View
33+
pointerEvents="none"
34+
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
35+
/>
36+
</View>
37+
</RoutedFormSheetContext>
3138
</FormSheet>
3239
);
3340
}

0 commit comments

Comments
 (0)