Skip to content

Commit 47bdafa

Browse files
committed
fix(mobile): keep floating shadows outside the touch layout
1 parent 1ed4832 commit 47bdafa

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ class T3WorkspaceNavigationModule : Module() {
7272
Prop("selectedTab") { view: T3WorkspaceNavigationView, value: String ->
7373
view.selectedTab = value
7474
}
75-
Prop("floating") { view: T3WorkspaceNavigationView, value: Boolean -> view.floating = value }
75+
Prop("floating") { view: T3WorkspaceNavigationView, value: Boolean ->
76+
view.floating = value
77+
view.clipToPadding = !value
78+
view.clipChildren = !value
79+
}
7680
Prop("rail") { view: T3WorkspaceNavigationView, value: Boolean -> view.rail = value }
7781
Prop("dark") { view: T3WorkspaceNavigationView, value: Boolean -> view.dark = value }
7882
Prop("textScale") { view: T3WorkspaceNavigationView, value: Float -> view.textScale = value }
@@ -164,6 +168,7 @@ class T3WorkspaceNavigationView(
164168
init {
165169
addView(
166170
ComposeView(context).apply {
171+
clipChildren = false
167172
setViewCompositionStrategy(
168173
ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool
169174
)

‎apps/mobile/src/features/workspace/AndroidWorkspaceNavigation.android.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,10 @@ export function FloatingWorkspaceTabs(props: {
177177
pointerEvents="box-none"
178178
style={{
179179
position: "absolute",
180-
left: 0,
180+
left: Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.shadow,
181181
right: 0,
182-
bottom: 0,
182+
bottom: insets.bottom + FLOATING_TABS.edge - FLOATING_TABS.shadow,
183183
alignItems: "flex-start",
184-
paddingLeft: Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.shadow,
185-
paddingBottom: insets.bottom + FLOATING_TABS.edge - FLOATING_TABS.shadow,
186184
}}
187185
>
188186
<AndroidWorkspaceNavigation {...props} floating />

‎apps/mobile/src/features/workspace/floating-workspace-tabs.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Native shadows need room inside the Expo view, which clips its children.
1+
// Keep the native drawing inset out of the visible size and edge margins.
22
export const FLOATING_TABS = { edge: 16, gap: 12, shadow: 8 };
33

44
export function floatingTabsMetrics(

0 commit comments

Comments
 (0)