@onekeyfe/react-native-bottom-tabs 6.7.0-alpha.475 → 6.8.0-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +139 -48
  2. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsDrawerManager.kt +15 -0
  3. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsDrawerView.kt +276 -54
  4. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsView.kt +426 -53
  5. package/android/src/main/java/com/onekey/bottomtabs/BottomTabsViewManager.kt +6 -5
  6. package/android/src/main/java/com/onekey/bottomtabs/FloatingTabBarStyle.kt +22 -6
  7. package/android/src/main/java/com/onekey/bottomtabs/events/TabDoublePressEvent.kt +7 -1
  8. package/docs/SPEC.md +212 -25
  9. package/ios/RCTBottomTabsComponentView.mm +4 -1
  10. package/ios/RCTBottomTabsContainerView.swift +263 -15
  11. package/ios/RCTBottomTabsDrawerComponentView.mm +24 -0
  12. package/ios/RCTBottomTabsDrawerContainerView.swift +314 -48
  13. package/ios/tests/BottomTabsDrawerReduceMotionTests.swift +231 -0
  14. package/lib/module/BottomTabs.js +85 -58
  15. package/lib/module/BottomTabsDrawerNativeComponent.ts +3 -0
  16. package/lib/module/BottomTabsNativeComponent.ts +6 -1
  17. package/lib/module/index.js +1 -0
  18. package/lib/typescript/src/BottomTabs.d.ts +23 -2
  19. package/lib/typescript/src/BottomTabsDrawerNativeComponent.d.ts +5 -0
  20. package/lib/typescript/src/BottomTabsNativeComponent.d.ts +5 -1
  21. package/lib/typescript/src/index.d.ts +1 -0
  22. package/package.json +1 -1
  23. package/react-native-bottom-tabs.podspec +6 -0
  24. package/src/BottomTabs.tsx +94 -44
  25. package/src/BottomTabsDrawerNativeComponent.ts +3 -0
  26. package/src/BottomTabsNativeComponent.ts +6 -1
  27. package/src/index.tsx +1 -0
@@ -35,8 +35,8 @@ class BottomTabsViewManager(context: ReactApplicationContext) :
35
35
  eventDispatcher?.dispatchEvent(PageSelectedEvent(surfaceId, view.id, key))
36
36
  }
37
37
 
38
- view.onTabDoublePressedListener = { key ->
39
- eventDispatcher?.dispatchEvent(TabDoublePressEvent(surfaceId, view.id, key))
38
+ view.onTabDoublePressedListener = { key, didScrollToTop ->
39
+ eventDispatcher?.dispatchEvent(TabDoublePressEvent(surfaceId, view.id, key, didScrollToTop))
40
40
  }
41
41
 
42
42
  view.onNativeLayoutListener = { width, height ->
@@ -207,9 +207,10 @@ class BottomTabsViewManager(context: ReactApplicationContext) :
207
207
  }
208
208
 
209
209
  // iOS-only props (no-ops on Android)
210
- // selectedIcons feeds UITabBarItem.selectedImage on iOS; Android keeps
211
- // swapping the icon in JS via the focusedKey-driven `icons` array.
212
- override fun setSelectedIcons(view: BottomTabsView?, value: ReadableArray?) {}
210
+ override fun setSelectedIcons(view: BottomTabsView?, value: ReadableArray?) {
211
+ if (view != null)
212
+ view.setSelectedIcons(value)
213
+ }
213
214
  override fun setTranslucent(view: BottomTabsView?, value: Boolean) {}
214
215
  override fun setSidebarAdaptable(view: BottomTabsView?, value: Boolean) {}
215
216
  override fun setScrollEdgeAppearance(view: BottomTabsView?, value: String?) {}
@@ -24,6 +24,14 @@ internal object FloatingTabBarMetrics {
24
24
  const val LENS_MAX_STRETCH = 0.16f
25
25
  const val ITEM_PRESSED_SCALE = 1.1f
26
26
  const val DRAG_EDGE_RESISTANCE = 0.22f
27
+
28
+ // Motion timings aligned with the iOS 26 Liquid Glass tab bar spring.
29
+ const val SLIDE_DURATION_MS = 520L
30
+ const val SLIDE_SPRING_DAMPING = 0.82f
31
+ const val SLIDE_SPRING_FREQUENCY = 7.5f
32
+ const val LIFT_UP_DURATION_MS = 220L
33
+ const val LIFT_SETTLE_DURATION_MS = 380L
34
+ const val LIFT_HOLD_DURING_SLIDE_MS = 200L
27
35
  }
28
36
 
29
37
  /**
@@ -31,20 +39,28 @@ internal object FloatingTabBarMetrics {
31
39
  * below 1 overshoots slightly before settling, matching UIKit spring motion.
32
40
  */
33
41
  internal class SpringInterpolator(
34
- private val dampingRatio: Float = 0.72f,
35
- private val angularFrequency: Float = 10f,
42
+ private val dampingRatio: Float = FloatingTabBarMetrics.SLIDE_SPRING_DAMPING,
43
+ private val angularFrequency: Float = FloatingTabBarMetrics.SLIDE_SPRING_FREQUENCY,
36
44
  ) : Interpolator {
37
45
  private val dampedFrequency =
38
46
  angularFrequency * sqrt(1f - dampingRatio * dampingRatio)
47
+ private val endValue = rawSpring(1f)
39
48
 
40
- override fun getInterpolation(input: Float): Float {
41
- if (input >= 1f) {
42
- return 1f
43
- }
49
+ private fun rawSpring(input: Float): Float {
44
50
  val decay = exp(-dampingRatio * angularFrequency * input)
45
51
  val phase = dampedFrequency * input
46
52
  return 1f - decay * (
47
53
  cos(phase) + (dampingRatio * angularFrequency / dampedFrequency) * sin(phase)
48
54
  )
49
55
  }
56
+
57
+ override fun getInterpolation(input: Float): Float {
58
+ if (input <= 0f) {
59
+ return 0f
60
+ }
61
+ if (input >= 1f || endValue == 0f) {
62
+ return 1f
63
+ }
64
+ return rawSpring(input) / endValue
65
+ }
50
66
  }
@@ -4,12 +4,18 @@ import com.facebook.react.bridge.Arguments
4
4
  import com.facebook.react.bridge.WritableMap
5
5
  import com.facebook.react.uimanager.events.Event
6
6
 
7
- class TabDoublePressEvent(surfaceId: Int, viewTag: Int, private val key: String) : Event<TabDoublePressEvent>(surfaceId, viewTag) {
7
+ class TabDoublePressEvent(
8
+ surfaceId: Int,
9
+ viewTag: Int,
10
+ private val key: String,
11
+ private val didScrollToTop: Boolean,
12
+ ) : Event<TabDoublePressEvent>(surfaceId, viewTag) {
8
13
  override fun getEventName(): String = EVENT_NAME
9
14
 
10
15
  override fun getEventData(): WritableMap {
11
16
  return Arguments.createMap().apply {
12
17
  putString("key", key)
18
+ putBoolean("didScrollToTop", didScrollToTop)
13
19
  }
14
20
  }
15
21
 
package/docs/SPEC.md CHANGED
@@ -44,9 +44,25 @@ and SF Symbols retain their existing resolution. The shared resolver is used for
44
44
  focused/unfocused icons and the iOS side-accessory icon.
45
45
 
46
46
  The default `getIcon` resolver has a stable identity. With the same routes array
47
- and resolver, iOS retains both normal and selected icon-source arrays across tab
48
- selection and unrelated renders. Replacing the routes array or supplying a new
49
- resolver recomputes both arrays. Android keeps its focus-dependent icon choice.
47
+ and resolver, both iOS and Android retain normal (`icons`) and selected
48
+ (`selectedIcons`) icon-source arrays across tab selection and unrelated renders,
49
+ and `items` does not recompute solely because `selectedPage` changes. Replacing
50
+ the routes array or supplying a new resolver recomputes both arrays. On Android,
51
+ `BottomTabsView` pre-loads both `icons` and `selectedIcons` into `drawableCache`
52
+ and swaps each `MenuItem`'s icon synchronously on the UI thread when selection
53
+ changes.
54
+
55
+ ## iOS icon completion updates
56
+
57
+ When normal or selected artwork arrives, update the existing `UITabBarItem`
58
+ images without rebuilding controllers or replacing items. Coalesce completed
59
+ indices into one main-queue update; use the current source/token ownership and
60
+ current tints, including SF Symbol and normal-image fallbacks. Item identity,
61
+ selection, labels, badges and accessibility identifiers remain intact. Structural
62
+ item changes retain the existing rebuild path. Android is unchanged.
63
+
64
+ Consumer simulator evidence covers cold launch, tab switching and light/dark
65
+ icon tint. Physical-device and rapid source/reorder acceptance remain pending.
50
66
 
51
67
  ## Native left drawer
52
68
 
@@ -58,6 +74,11 @@ The static Home example also passed a focused TypeScript check.
58
74
  Detailed iOS runtime evidence is recorded separately; physical-device and exact
59
75
  reference-video acceptance remain pending.
60
76
 
77
+ Reference-recording motion revision: implemented on iOS and Android. iOS is
78
+ runtime verified in the consumer app on an iPhone 17 simulator; Android is
79
+ source-complete with updated native tests that still need an emulator run (see
80
+ Conformance below).
81
+
61
82
  `renderDrawerContent?: () => React.ReactNode` supplies an optional menu slot.
62
83
  `drawerOpen?: boolean` defaults to false and requests its stable open state.
63
84
  `onDrawerOpenChange?: (open: boolean) => void` reports a completed user transition;
@@ -70,8 +91,28 @@ screen). Existing `hapticFeedbackEnabled` enables one light native haptic after
70
91
  a completed user transition changes the stable state. Programmatic updates and
71
92
  cancelled gestures do not vibrate.
72
93
 
94
+ `onDrawerProgress?: (event) => void` receives `{ progress }`, the displayed
95
+ progress clamped to [0, 1], while the drawer moves. Native emits it only while
96
+ a handler is set (the wrapper derives the internal `progressEventsEnabled` prop
97
+ from the handler's presence), at most once per frame, when progress changed by
98
+ at least .002, and always on reaching 0 or 1. Enabling it emits the current
99
+ value once, so a new subscriber starts in sync. The wrapper enables it one
100
+ commit after mount, once the host's event emitter and an animated host's
101
+ worklet handler are attached; on iOS the host also re-sends the current value
102
+ when Fabric attaches the event emitter after a mount's first props. The handler is passed to the
103
+ host unchanged, so `drawerHostComponent?` (default: the native host) can be an
104
+ animated wrapper such as `Animated.createAnimatedComponent(BottomTabsDrawerNative)`
105
+ whose worklet handler consumes the event on the UI thread. The package does
106
+ not depend on Reanimated; `BottomTabsDrawerNative` is exported for this use.
107
+ `drawerColorScheme?: "light" | "dark"` selects the page palette below; when
108
+ omitted the internal `colorScheme` prop is `"system"` and follows the iOS trait
109
+ collection or the Android configuration's night mode. Pass the app theme when
110
+ it can differ from those (an app-level iOS window style override is followed
111
+ without it).
112
+
73
113
  The drawer is physically left on both iOS and Android, including RTL. Its width
74
- is 78 percent of the host. The foreground is the full tab container, including
114
+ is 80 percent of the host, and the React menu slot is laid out at the same
115
+ 80 percent so its descendants reach the menu's edge. The foreground is the full tab container, including
75
116
  the native tab bar and an optional custom JS bar. It keeps its full width and
76
117
  height while moving right, without scaling, scene reparenting or remounting.
77
118
  The native host and two slots remain mounted when the drawer is disabled or its
@@ -80,12 +121,19 @@ an event, and passes foreground input through. Web omits the drawer host/menu
80
121
  and passes the existing tab content through; it implements no drawer gestures.
81
122
  The existing tab view's other Web support is unchanged.
82
123
 
83
- For normalized progress `p` in [0, 1], foreground translation is `.78 * width * p`,
84
- its left circular corner radius is `64 * p` points/dp and its neutral gray
85
- dim surface (RGB 28/28/28) has opacity `.7 * p`.
86
- The menu translates from `-.12 * drawerWidth` to zero; a black menu shade fades
87
- from .12 to zero. These are initial reference-video tuning values, not a claim
88
- of pixel-perfect parity. Closed menus are hidden from touch/accessibility;
124
+ For normalized progress `p` in [0, 1], foreground translation is `.8 * width * p`
125
+ and its left circular corner radius is `62 * min(1, p / .1)` points/dp, so
126
+ screens with other display corners never show a radius jump. The dim surface
127
+ washes the page linearly: white at `.5 * p` in the light palette, RGB 36/36/36
128
+ at `.58 * p` in the dark palette. In the light palette the page also casts a
129
+ black shadow under its left edge and corners, opacity .16, Gaussian sigma 18
130
+ points/dp, no offset, following the current corner radius; in the dark palette it instead draws a one-physical-pixel
131
+ white edge at 17 percent opacity. The menu scales from .97 to 1 about its
132
+ left-center edge (1 throughout when motion is reduced, see below) and its
133
+ opacity is `min(1, p / .6)`. The host itself is transparent, so whatever lies
134
+ behind it shows through the fading menu and its scaled-down margins.
135
+ These values were measured frame by frame from the reference recording.
136
+ Closed menus are hidden from touch/accessibility;
89
137
  while visible, the foreground is blocked by a native dim surface. Tapping that
90
138
  surface closes the drawer. iOS accessibility escape and Android Back close an
91
139
  open drawer; the dim surface exposes an accessible close action.
@@ -137,27 +185,57 @@ Vertical gestures fail before taking ownership. Active touches interrupted by
137
185
  a second finger, system cancellation, disabling, detach or a newer prop update
138
186
  cannot later emit an event. Cancellation returns to the previous stable state,
139
187
  or resumes an external target whose programmatic animation the gesture interrupted.
140
- No gesture progress crosses the JS bridge.
141
-
142
- Both platforms settle on their UI thread with the same critically damped curve:
143
- `p(t) = target + (a + b*t) * exp(-22*t)`, where `a = p0-target`,
144
- `b = v0 + 22*a`, and normalized velocity `v0` is clamped to [-8, 8] per second.
145
- Presentation is clamped to [0, 1], and the transition ends at or before 500 ms.
146
- Release targets open when `p + v0*.12 >= .5`. A newer animation or touch starts
147
- from the current displayed progress and cancels the previous completion.
188
+ Gesture progress crosses the JS bridge only through the opt-in `onDrawerProgress`.
189
+
190
+ Both platforms settle on their UI thread with the same curves. A tap, dim
191
+ close, Back/escape or prop change starting from rest eases with
192
+ cubic-bezier(.55, .6, .2, 1) over `max(.12, D * |target - p0|)` seconds, where D
193
+ is .36 to open and .29 to close. A released drag settles on a spring with
194
+ natural frequency 25.5 rad/s and damping ratio .84, starting from its normalized
195
+ finger velocity `v0` clamped to [-12, 12] per second; release targets open when
196
+ `p + v0*.12 >= .5`. Only this spring may carry the page past open, by at most
197
+ 3 percent of the drawer width; reported progress and touch/accessibility state
198
+ stay clamped to [0, 1]. The spring ends once within .0005 of its target and
199
+ slower than .02 per second, or at 600 ms. A request for a different target
200
+ while animating continues from the displayed progress with its current
201
+ velocity on the spring; a request for the same target keeps the running
202
+ animation and only replaces whether its completion is a user transition. A
203
+ touch starts from the current displayed progress and cancels the previous
204
+ completion. When the system asks for less motion (iOS Reduce Motion; Android
205
+ with animator duration scale 0), the menu does not scale. On iOS a tap,
206
+ close or prop change from rest then cross-fades from a snapshot to the final
207
+ state over 200 ms instead of moving, and a released drag settles critically
208
+ damped (damping ratio 1) without travelling past its target. A cross-fade is
209
+ an in-flight transition like an animation: its final state shows at once under
210
+ the snapshot, but the stable state, `onDrawerOpenChange` and the haptic follow
211
+ only when the fade ends. A newer cross-fade replaces the previous snapshot
212
+ (capturing it as currently shown). A request for the target already being
213
+ faded to leaves the fade running and only replaces whether its completion is a
214
+ user transition. A touch, an animated settle, a newer cross-fade, disabling or
215
+ detach removes the snapshot without completing it, as a touch does a running
216
+ animation, so a drag that begins during a faded close never receives that
217
+ close's prop echo; a resize completes it at once. While the snapshot shows, the
218
+ host takes every touch itself, so none reaches a page, menu or dim control that
219
+ is already in the final state under it; the drawer pan still receives them.
220
+ Android has no separate reduced-motion setting and lands such transitions
221
+ immediately.
148
222
  Resize snaps a pending settlement to its target, emitting its user event once
149
223
  if appropriate; an active drag follows the same cancellation rule. Detach cancels
150
224
  animations and callbacks; reattachment reapplies the latest external target.
151
225
  The host retains at most one display-link/animator, one touch
152
- sequence, two React child slots, and native dim surfaces. It owns no snapshots,
153
- workers, persistence, JS animation objects, RNGH or Reanimated dependency.
226
+ sequence, two React child slots, and native dim surfaces; on iOS one transient
227
+ snapshot during a reduced-motion cross-fade, removed when it ends; on Android
228
+ one hardware layer on the menu while its opacity is strictly between 0 and 1,
229
+ and three gradient shaders for the page shadow, rebuilt only when the corner
230
+ radius, height or palette changes. It owns no workers, persistence, JS
231
+ animation objects, RNGH or Reanimated dependency.
154
232
 
155
233
  Implementation boundaries: `src/BottomTabs.tsx` owns slots and settled callbacks;
156
234
  `src/BottomTabsDrawerNativeComponent.ts` defines the Fabric boundary;
157
235
  `ios/RCTBottomTabsDrawerContainerView.swift` and
158
236
  `android/src/main/java/com/onekey/bottomtabs/BottomTabsDrawerView.kt` own native
159
237
  input, layout, animation and cleanup. The iOS Fabric component and Android manager only forward children,
160
- props and the settled event. Required acceptance includes both bar styles,
238
+ props, the settled event and the opt-in progress event. Required acceptance includes both bar styles,
161
239
  custom bars, content/vertical gestures, dim close, rapid reversal, cancellation,
162
240
  disable/remove-content, resize, detach, accessibility, RTL and bottom-bar
163
241
  gesture ownership, including a real pager, nested horizontal list and vertical
@@ -165,6 +243,31 @@ scrolling in the complete Fabric example. Source checks and emulator checks do n
165
243
  device smoothness or exact reference-video fidelity.
166
244
  The Android native suite also exercises generated drawer prop forwarding in RTL,
167
245
  physical-left placement, and closing pans while opening swipes are disabled.
246
+ For the reference-recording revision it asserts the 80 percent travel, the
247
+ light and dark wash, the menu's final scale/opacity/layer, and that progress
248
+ events are opt-in, start in sync and end on the stable state; the wrapper tests
249
+ assert that progress stays off without a handler and during the mount commit,
250
+ that the handler, a replacement host and the color scheme reach native
251
+ unchanged, and that the menu slot is 80 percent wide. The iOS suite
252
+ `ios/tests/BottomTabsDrawerReduceMotionTests.swift` runs without an app host,
253
+ forcing Reduce Motion and supplying the fade snapshot through internal test
254
+ hooks. It asserts that a user close reports once, after the snapshot is gone;
255
+ that a drag taking over the fade drops the faded close and reports only its own
256
+ release; that a resize lands the fade at once; that same-target and newer
257
+ requests, disabling and detach take over or drop the pending report; and that
258
+ touches during an opening or closing fade land on the host, not on the menu,
259
+ page or dim under the snapshot.
260
+ Recorded evidence so far: on the iPhone 17 simulator (iOS 26) in the consumer
261
+ app, tap open/close timing, fling overshoot (about 2 points), smooth reversal,
262
+ the corner ramp, the reduced-motion cross-fade, the light/dark palettes and a
263
+ UI-thread Reanimated progress handler were compared frame by frame with the
264
+ reference recording. After the review fixes, the same setup showed menu content
265
+ reaching 20 points from the 80 percent edge, the header avatar hidden at full
266
+ open through the deferred progress event, no travel past open on a
267
+ reduced-motion fling, and three toggles within 120 ms under Reduce Motion
268
+ cross-fading to the final state with no leftover image (snapshot replacement
269
+ itself is source-verified). The Android suite has not yet been run for this revision;
270
+ physical-device smoothness on either platform remains unverified.
168
271
 
169
272
  The standalone `example/react-native/pages/BottomTabsHomeDrawerExample.tsx`
170
273
  reproduces Home’s wallet toolbar, balance/actions/banner shared header and
@@ -187,11 +290,44 @@ reselection never changes the selected page. A tab with `preventsDefault` emits
187
290
  tab within the platform double-tap timeout (iOS 0.3 s; Android
188
291
  `ViewConfiguration.getDoubleTapTimeout()`, 300 ms by default). Both presses still
189
292
  emit `onPageSelected` first; the double press is an additional event, emitted
190
- after the second press. After it fires, tracking resets, so a third quick press
293
+ after the second press. A rejected pager top request with no accepted scroll
294
+ suppresses this additional event; both `onPageSelected` events still fire.
295
+ After the pair is handled, tracking resets, so a third quick press
191
296
  starts a new pair. Double press is derived from accepted selections only: no
192
297
  extra gesture recognizer is attached and single-press latency is unchanged.
193
298
  JS-driven `selectedPage` changes do not count as presses.
194
299
 
300
+ Before `onTabDoublePress` is emitted, the selected tab's visible vertical
301
+ scrollers animate back to their top only when the pressed key matches the
302
+ selected scene. If `preventsDefault` leaves another tab selected, its scene
303
+ MUST remain untouched and `didScrollToTop` MUST be false. A prevented tab that
304
+ is already selected retains normal scroll-to-top behavior.
305
+ The event carries `didScrollToTop`: true only when at least one scroller was
306
+ away from its top and accepted the top request, false when all were already
307
+ there, so the host can decide what a double press at the top means. Rejection
308
+ MUST NOT be reported as success or as proof that the page is already at top.
309
+ On iOS, a standalone NativeList collection view delegates back to its direct
310
+ owner's `onekeyScrollToOffset:animated:` selector with offset zero and animation
311
+ enabled. This uses NativeList's existing explicit-command path to end an active
312
+ structural tail, invalidate stale scroll completions and own pending layout
313
+ before scrolling; BottomTabs MUST NOT also write that collection view's offset.
314
+ BottomTabs and NativeList native sources must ship together for this selector.
315
+ Scrollers inside a `CollapsiblePagerView` are never moved directly because the pager owns
316
+ their header state; the module calls the pager's own `tryScrollToTop` by name, as
317
+ it has no package dependency on the pager. A pager also counts as away from its
318
+ top when its `isAwayFromPageTop` reports a collapsed header over a body at top. Only visible scrollers count: hidden
319
+ tabs and off-screen pager pages are skipped. On iOS visibility is intersected
320
+ with the window and every clipping ancestor; a retained page fully clipped by
321
+ its pager MUST NOT count. On iOS a scroller must have content
322
+ taller than its viewport. Runtime verification: iOS 27 simulator (collapsible
323
+ pagers, pushed list pages, and a double press that also switches tabs). The
324
+ Android pressed-scene isolation regression passed on an API 36 emulator for
325
+ docked and floating bars; Android pager integration has not been run. The
326
+ Android pager lookup is reflective, so a minified release build still needs a run.
327
+ BottomTabs and Pager native sources must ship together for the acceptance-returning
328
+ entry point. Clipping-ancestor visibility and rejected-command event handling
329
+ are implemented in source; runtime acceptance for these cases remains pending.
330
+
195
331
  Tab long press is not supported. The former `onTabLongPress` prop/event and the
196
332
  native long-press recognizers were removed.
197
333
 
@@ -206,6 +342,36 @@ that delay, cancel, or require failure of the system tab bar gestures.
206
342
  The previous drag-cancellation guard (which refused selection for any touch that
207
343
  moved more than 10 points) was removed because it disabled drag-to-switch.
208
344
 
345
+ ## iOS bottom tab bar hide and show transition
346
+
347
+ Status: implemented in module source and verified on iOS 27.0 Simulator XCTest.
348
+
349
+ When `tabBarHidden` changes dynamically while the container view is attached to a
350
+ window, laid out with nonzero bounds, and in `bottom` placement, `RCTBottomTabsContainerView`
351
+ animates `UITabBar.transform` vertically with a critically damped 0.28 s spring
352
+ (`usingSpringWithDamping: 1.0`, `.beginFromCurrentState`, `.curveEaseOut`,
353
+ `.allowUserInteraction`) by `max(tabBar.bounds.height, 62) + 12` points so the
354
+ floating Liquid Glass capsule slides smoothly off and back onto the bottom edge.
355
+
356
+ - **Immediate state & measurement:** `tabBar.isUserInteractionEnabled` and
357
+ `onTabBarMeasured` (`0` when hiding, `tabBar.bounds.height` when showing)
358
+ update immediately when `tabBarHidden` changes, without waiting for animation
359
+ completion.
360
+ - **Hide transition:** UIKit's system visibility (`setTabBarHidden(false, animated: false)`)
361
+ stays active while the bar slides down so layout passes triggered by concurrent
362
+ child navigation pushes do not snap `tabBar.alpha` to zero. When the slide-out
363
+ completes (and no newer `tabBarHidden` transition has superseded it), the view
364
+ resets `tabBar.transform = .identity` and applies `setTabBarHidden(true, animated: false)`
365
+ inside `UIView.performWithoutAnimation`.
366
+ - **Show transition & reversal:** showing unhides the system bar without animation,
367
+ seeds `tabBar.transform` at the downward offset when transitioning from a
368
+ settled hidden state (or preserves the in-flight transform on mid-transition
369
+ reversal), and animates back to `.identity`.
370
+ - **Non-animated cases:** initial setup, detached views (`window == nil`), zero-sized
371
+ containers, and `leading`/`trailing` vertical placements apply visibility
372
+ immediately without animation, strip active layer animations, and reset
373
+ `tabBar.transform` to `.identity`.
374
+
209
375
  ## Android tab bar style
210
376
 
211
377
  `androidTabBarStyle` selects the Android presentation; iOS ignores it.
@@ -248,9 +414,23 @@ Floating interaction (single finger; motion splitting is disabled):
248
414
  Release after a drag selects the candidate once, only if it differs from the
249
415
  current tab. Cancel selects nothing.
250
416
  4. The lens then settles back into the pill on the selected tab, which stays on
251
- the old tab for cancelled or `preventsDefault` presses.
252
-
253
- JS-driven selection changes slide the pill with a spring and velocity stretch.
417
+ the old tab for cancelled or `preventsDefault` presses. When a stationary tap
418
+ releases while the indicator slide is still in flight, the lifted lens holds
419
+ briefly (proportional to the remaining slide fraction) before settling into
420
+ the resting pill as it arrives at the target tab.
421
+
422
+ Both press-initiated and JS-driven selection changes slide the pill with a
423
+ 520 ms underdamped spring (`dampingRatio = 0.82`, `angularFrequency = 7.5`) and
424
+ frame-rate-normalized velocity stretch (16 ms reference step). An in-flight
425
+ slide animator already targeting the selected tab's X position is preserved
426
+ across touch release and subsequent JS `selectedPage` or `items` syncs instead
427
+ of being restarted or snapped.
428
+ When `tabBarHidden` changes dynamically while attached and laid out in `floating`
429
+ style, `BottomTabsView` animates `floatingBar.translationY` across its visible
430
+ bottom clearance (`DecelerateInterpolator`), preserving in-flight translation on
431
+ rapid reversals, keeping the live blur backdrop active while the bar slides off
432
+ screen, immediately reporting the updated measured height (`0` when hidden), and
433
+ setting `floatingBar.visibility = GONE` upon hide completion.
254
434
  Switching style at runtime rebuilds the bar and restores Material's label sizes,
255
435
  icon size, ripple, padding, and gravity when returning to `default`.
256
436
 
@@ -383,6 +563,13 @@ pages; release selects the nearest tab once; cancel restores; hidden bar, dark
383
563
  mode, and 3-button navigation insets lay out correctly. Source compilation is
384
564
  recorded separately from runtime acceptance.
385
565
 
566
+ `native-tests/android/BottomBlurTest.kt` includes
567
+ `testDoublePressOnlyScrollsThePressedScene`, inherited by the floating-style
568
+ suite. It covers a prevented press on another scene (no scroll, false), a
569
+ prevented press on the selected scene (scroll, true), and normal tab switching
570
+ followed by scroll-to-top, while preserving the other scene's offset. The same
571
+ cases remain required on iOS.
572
+
386
573
  Vertical tab bar: `RCTBottomTabsContainerView.swift` (`currentTabBarPlacement`,
387
574
  `updateTabBarPlacementAndSideAccessory`, `verticalTabBarPlatterFrame`).
388
575
  Required iOS runtime cases on iPhone Duo: the outer display and landscape inner
@@ -144,7 +144,10 @@ static NSArray<NSDictionary *>* convertItemsToArray(const std::vector<RNBottomTa
144
144
  if (!strongSelf) return;
145
145
  auto emitter = std::static_pointer_cast<const RNBottomTabsViewEventEmitter>(strongSelf->_eventEmitter);
146
146
  if (emitter) {
147
- emitter->onTabDoublePress({.key = std::string([[body objectForKey:@"key"] UTF8String] ?: "")});
147
+ emitter->onTabDoublePress({
148
+ .key = std::string([[body objectForKey:@"key"] UTF8String] ?: ""),
149
+ .didScrollToTop = [[body objectForKey:@"didScrollToTop"] boolValue],
150
+ });
148
151
  }
149
152
  };
150
153
  [_containerView setValue:onTabDoublePress forKey:@"onTabDoublePress"];