@onekeyfe/react-native-native-overlay 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 (41) hide show
  1. package/README.md +119 -21
  2. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEntryRootView.kt +60 -0
  3. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayView.kt +12 -0
  4. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayViewManager.kt +8 -0
  5. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayMotionTest.kt +42 -0
  6. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlaySheetInsetTest.kt +78 -0
  7. package/docs/SPEC.md +189 -24
  8. package/ios/NativeOverlayContainerView.swift +6 -0
  9. package/ios/NativeOverlayWindowManager.swift +244 -7
  10. package/lib/module/NativeOverlayNativeComponent.ts +13 -0
  11. package/lib/module/OverlayView.js +7 -1
  12. package/lib/module/OverlayView.js.map +1 -1
  13. package/lib/module/animation/anchoredOrigin.js +26 -0
  14. package/lib/module/animation/anchoredOrigin.js.map +1 -0
  15. package/lib/module/animation/resolveAnimation.js +26 -4
  16. package/lib/module/animation/resolveAnimation.js.map +1 -1
  17. package/lib/module/index.js +1 -0
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/module/web/animateTransition.js +38 -12
  20. package/lib/module/web/animateTransition.js.map +1 -1
  21. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts +13 -0
  22. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts.map +1 -1
  23. package/lib/typescript/src/OverlayView.d.ts.map +1 -1
  24. package/lib/typescript/src/animation/anchoredOrigin.d.ts +7 -0
  25. package/lib/typescript/src/animation/anchoredOrigin.d.ts.map +1 -0
  26. package/lib/typescript/src/animation/resolveAnimation.d.ts +9 -3
  27. package/lib/typescript/src/animation/resolveAnimation.d.ts.map +1 -1
  28. package/lib/typescript/src/animation/types.d.ts +5 -1
  29. package/lib/typescript/src/animation/types.d.ts.map +1 -1
  30. package/lib/typescript/src/index.d.ts +1 -0
  31. package/lib/typescript/src/index.d.ts.map +1 -1
  32. package/lib/typescript/src/web/animateTransition.d.ts +12 -0
  33. package/lib/typescript/src/web/animateTransition.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/src/NativeOverlayNativeComponent.ts +13 -0
  36. package/src/OverlayView.tsx +7 -0
  37. package/src/animation/anchoredOrigin.ts +35 -0
  38. package/src/animation/resolveAnimation.ts +28 -7
  39. package/src/animation/types.ts +5 -1
  40. package/src/index.ts +1 -0
  41. package/src/web/animateTransition.ts +54 -14
package/README.md CHANGED
@@ -1,35 +1,133 @@
1
+ <div align="center">
2
+
1
3
  # @onekeyfe/react-native-native-overlay
2
4
 
3
- Native and Web overlay hosts with ordered levels, page scope, lifecycle events,
4
- keyboard avoidance and Fabric measurement. See [SPEC](docs/SPEC.md) for the
5
- behavioral contract, platform differences and outstanding runtime acceptance.
5
+ **Overlay hosts that draw above the app on iOS, Android and Web while keeping the caller's React subtree and hit testing intact.**
6
+
7
+ [![npm](https://img.shields.io/npm/v/%40onekeyfe%2Freact-native-native-overlay?label=npm&color=4D6BFE)](https://www.npmjs.com/package/@onekeyfe/react-native-native-overlay)
8
+ [![license](https://img.shields.io/npm/l/%40onekeyfe%2Freact-native-native-overlay?label=license&color=4D6BFE)](LICENSE)
9
+ ![iOS](https://img.shields.io/badge/iOS-000000?logo=apple&logoColor=white)
10
+ ![Android](https://img.shields.io/badge/Android-3DDC84?logo=android&logoColor=white)
11
+ ![Web](https://img.shields.io/badge/Web-4285F4?logo=googlechrome&logoColor=white)
12
+ ![Fabric](https://img.shields.io/badge/Fabric-4D6BFE)
13
+
14
+ </div>
15
+
16
+ Owns where an overlay is drawn, which overlay is on top and how it enters and
17
+ exits. Levels are fixed (`modal`, `hardware`, `secure`, `toast`, `lock`,
18
+ `debug`), each entry picks a `global` or `page` scope and a lane strategy, and
19
+ the native host reparents the caller's content so React context, refs and
20
+ `measureInWindow` keep working. Sheet, center, fullscreen, toast and anchored
21
+ presentations are available; the application owns the content and business UI.
22
+
23
+ ## Features
24
+
25
+ - **Predictable ordering** — every page entry renders below every global entry,
26
+ and inside a scope entries sort by level and then by request order.
27
+ - **Lane strategies** — `stack`, `queue` and `replace` apply per
28
+ (scope, host, level) lane, with `priority`, `replaceKey` and de-duplicated ids.
29
+ - **Preserved React identity** — the overlay view stays where the caller
30
+ rendered it; native code moves its content into the host, so there is no
31
+ portal that drops context.
32
+ - **Page scope that covers chrome** — `OverlayPageHost` as the last child of a
33
+ root route lets page overlays cover native headers and the tab bar.
34
+ - **Native presentation and motion** — sheet drag, back handling, keyboard
35
+ avoidance, status bar styling and configurable enter/exit animations.
36
+ - **Web parity** — the Web implementation portals into z-indexed level layers
37
+ with a focus trap and page isolation.
38
+
39
+ ## Installation
40
+
41
+ ```sh
42
+ yarn add @onekeyfe/react-native-native-overlay
43
+ ```
44
+
45
+ The native hosts are React Native Fabric codegen components, not Nitro views.
46
+ Install the app's iOS pods and rebuild the native application after adding the
47
+ package. Web additionally needs `react-dom`; it is declared as an optional peer
48
+ dependency.
49
+
50
+ ## Usage
6
51
 
7
52
  ```tsx
8
- import { OverlayView } from '@onekeyfe/react-native-native-overlay';
53
+ import { useState } from 'react';
54
+ import {
55
+ OverlayPageHost,
56
+ OverlayView,
57
+ } from '@onekeyfe/react-native-native-overlay';
9
58
 
10
- <OverlayView open={open} presentation="sheet" level="modal">
11
- {content}
12
- </OverlayView>;
59
+ function MainRoute() {
60
+ const [visible, setVisible] = useState(false);
61
+ return (
62
+ <>
63
+ {screen}
64
+ <OverlayView
65
+ visible={visible}
66
+ presentation="sheet"
67
+ level="modal"
68
+ sheet={{ dismissOnPanDown: true, cornerRadius: 24 }}
69
+ onRequestDismiss={() => setVisible(false)}
70
+ >
71
+ {content}
72
+ </OverlayView>
73
+ {/* Last child of the root route, after its navigator. */}
74
+ <OverlayPageHost hostKey="main" />
75
+ </>
76
+ );
77
+ }
13
78
  ```
14
79
 
15
- Global levels are ordered modal, hardware, secure, toast, lock, then debug.
16
- React context stays attached to the original subtree while the native host
17
- reparents its contents. Page overlays use `OverlayPageHost` and
18
- `OverlayPageHostScope` / `OverlayPageOwnerScope`. Android and iOS require the React Native new
19
- architecture; Web additionally requires `react-dom`.
80
+ The application still owns `visible` and the content. `scope="page"` resolves
81
+ `hostKey`/`ownerKey` from the nearest `OverlayPageHostScope` and
82
+ `OverlayPageOwnerScope` providers.
83
+
84
+ ## API
85
+
86
+ | Export | Shape | Description | Platforms |
87
+ | --- | --- | --- | :-: |
88
+ | `OverlayView` | component | Declarative overlay: `visible`, `scope`, `level`, `strategy`, `priority`, `replaceKey`, `presentation`, `sheet`, `animation`, `backdrop`, `blocking`, `keepContentMounted`, `statusBarStyle`, `contentSize`, dismiss/present callbacks. | iOS, Android, Web |
89
+ | `OverlayPageHost` | component | Renders the page-scope overlays of one root route from `hostKey`. | iOS, Android, Web |
90
+ | `OverlayPageHostScope`, `OverlayPageOwnerScope` | providers | Supply `hostKey` per root route and `ownerKey` per page. | iOS, Android, Web |
91
+ | `overlayStore` | store | Imperative `request`, `dismiss`, `finalize`, `reopen`, `dismissAll`, `setPageVisible`, `removePage`, `resolveBack`. | iOS, Android, Web |
92
+ | `OverlayRequestError` | error class | Thrown for invalid requests such as a page entry without keys. | iOS, Android, Web |
93
+ | `OVERLAY_LEVELS`, `OVERLAY_LEVEL_ORDER` | constants | The level list and their numeric order. | iOS, Android, Web |
94
+ | `resolveOverlayAnimation`, `OVERLAY_MOTION_PRESETS`, `NATIVE_MOTION_PRESETS`, `WEB_MOTION_PRESETS` | helpers | Resolve animation configs per platform. | iOS, Android, Web |
95
+
96
+ `presentation` accepts `sheet`, `center`, `fullscreen`, `toast` and `anchored`.
97
+ `strategy` accepts `stack`, `queue` and `replace`. See
98
+ [`docs/SPEC.md`](docs/SPEC.md) for the ownership model, platform differences and
99
+ acceptance record.
100
+
101
+ ## Platform support
102
+
103
+ | Capability | iOS | Android | Web |
104
+ | --- | :-: | :-: | :-: |
105
+ | Global overlays and level ordering | ✅ | ✅ | ✅ |
106
+ | Page scope via `OverlayPageHost` | ✅ | ✅ | ✅ |
107
+ | Sheet presentation | ✅ | ✅ | ✅ |
108
+ | Keyboard avoidance | ✅ | ✅ | ✅ |
109
+ | `windowOffsetRequest` for modal-relative anchors | ✅ | — | — |
110
+ | `contentSize` for pre-rotation layout | ✅ | ✅ | — |
111
+ | Status bar styling | ✅ | ✅ | — |
112
+
113
+ ## Caveats
20
114
 
21
- ## Development
115
+ > [!IMPORTANT]
116
+ > Page-scope entries need both `hostKey` and `ownerKey`. A declarative
117
+ > `OverlayView` waits until the nearest scope providers supply them, but a
118
+ > direct `overlayStore.request` with a missing key throws `OverlayRequestError`.
22
119
 
23
- Run `yarn typecheck`, `yarn lint`, `yarn test --runInBand`, and `yarn prepare`.
24
- This package was initialized from the repository view template and retains
25
- Fabric rather than Nitro under the explicit exception recorded in the SPEC.
120
+ > [!NOTE]
121
+ > The `windowOffsetRequest`/`onWindowOffset` and `contentSize` props are
122
+ > native-only layout aids; they do nothing on Web. On Web the overlay portals
123
+ > into a level layer and relies on `react-dom`.
26
124
 
27
- ## Release
125
+ ## References
28
126
 
29
- Use the repository `package-publish` CI workflow. This branch's synchronized
30
- 42-package batch is `3.0.162-alpha.270`, published under `next`; no PR merge or
31
- stable-tag change is required. Consumers must pin the exact verified version.
127
+ - [Package spec](docs/SPEC.md)
128
+ - [Public exports](src/index.ts)
129
+ - [Changelog](../../CHANGELOG.md)
32
130
 
33
131
  ## License
34
132
 
35
- MIT
133
+ MIT. See [LICENSE](LICENSE).
@@ -103,6 +103,9 @@ internal class NativeOverlayEntryRootView(
103
103
  private var imeBottom = 0
104
104
  private var safeTop = 0
105
105
  private var sheetBottomPadding = 0
106
+ /** Paints the platform sheet's navigation-bar inset strip. */
107
+ internal var sheetBottomInsetPaintView: View? = null
108
+ private set
106
109
  private var keyboardAnimating = false
107
110
 
108
111
  /** `sheet` presentation: the draggable surface; otherwise null. */
@@ -156,6 +159,8 @@ internal class NativeOverlayEntryRootView(
156
159
  backgroundColor: Int,
157
160
  showHandle: Boolean,
158
161
  draggable: Boolean,
162
+ bottomInsetColor: Int? = null,
163
+ bottomInsetHorizontalPx: Float = 0f,
159
164
  ) {
160
165
  val sheet = sheetView ?: createSheet()
161
166
  (sheet.background as? GradientDrawable)?.apply {
@@ -178,6 +183,60 @@ internal class NativeOverlayEntryRootView(
178
183
  params.height = targetHeight
179
184
  sheet.layoutParams = params
180
185
  }
186
+ updateSheetBottomInsetPaint(sheetBottomPadding, bottomInsetColor, bottomInsetHorizontalPx)
187
+ }
188
+
189
+ /**
190
+ * `sheet` presentation: the sheet pads its content by the navigation-bar
191
+ * inset so the content sits above the system bar. When JS draws the surface
192
+ * the platform sheet stays transparent, and the JS safe-area tail cannot
193
+ * paint this strip on Android: it hangs below the React content root, which
194
+ * Android does not composite outside its bounds. Paint the strip natively
195
+ * with the drawn surface color instead. A null color keeps it transparent
196
+ * for platform-painted sheets.
197
+ */
198
+ internal fun updateSheetBottomInsetPaint(
199
+ insetPx: Int,
200
+ color: Int?,
201
+ horizontalInsetPx: Float,
202
+ ) {
203
+ val sheet = sheetView ?: return
204
+ if (color == null || insetPx <= 0) {
205
+ sheetBottomInsetPaintView?.let { paint ->
206
+ sheet.removeView(paint)
207
+ sheetBottomInsetPaintView = null
208
+ }
209
+ return
210
+ }
211
+ val paint = sheetBottomInsetPaintView ?: View(reactContext).apply {
212
+ isClickable = false
213
+ isFocusable = false
214
+ importantForAccessibility = IMPORTANT_FOR_ACCESSIBILITY_NO
215
+ // Index 0 keeps the strip behind the sheet content.
216
+ sheet.addView(
217
+ this,
218
+ 0,
219
+ LayoutParams(LayoutParams.MATCH_PARENT, 0).apply { gravity = Gravity.BOTTOM },
220
+ )
221
+ sheetBottomInsetPaintView = this
222
+ }
223
+ paint.setBackgroundColor(color)
224
+ // The content height can be fractional; overlap it by a couple of points so
225
+ // rounding cannot leave an unpainted row above the strip. Both views share
226
+ // the same surface color, so the overlap is invisible.
227
+ val height = insetPx + (2 * resources.displayMetrics.density).toInt()
228
+ val horizontal = horizontalInsetPx.toInt().coerceAtLeast(0)
229
+ val params = paint.layoutParams as LayoutParams
230
+ if (
231
+ params.height != height ||
232
+ params.leftMargin != horizontal ||
233
+ params.rightMargin != horizontal
234
+ ) {
235
+ params.height = height
236
+ params.leftMargin = horizontal
237
+ params.rightMargin = horizontal
238
+ paint.layoutParams = params
239
+ }
181
240
  }
182
241
 
183
242
  /** The sheet's full height, navigation bar padding included. */
@@ -242,6 +301,7 @@ internal class NativeOverlayEntryRootView(
242
301
  sheetAnimationView = coordinator
243
302
  sheetBehavior = behavior
244
303
  handleView = handle
304
+ sheetBottomInsetPaintView = null
245
305
  return sheet
246
306
  }
247
307
 
@@ -69,6 +69,10 @@ class NativeOverlayView(
69
69
  var sheetCornerRadius = 24.0
70
70
  var showHandle = false
71
71
  var sheetBackgroundColor: Int? = null
72
+ /** Paints the platform sheet's bottom inset with the drawn surface color. */
73
+ var sheetBottomInsetColor: Int? = null
74
+ /** Horizontal inset of the drawn surface inside the sheet, in points. */
75
+ var sheetBottomInsetHorizontal = 0.0
72
76
  var dismissOnPanDown = true
73
77
  var animationConfig: String? = null
74
78
  var onPresented: ((Int) -> Unit)? = null
@@ -235,6 +239,12 @@ class NativeOverlayView(
235
239
  notifyHostEntriesChanged()
236
240
  val transition = config.exit.reduceMotionAdjusted(isReduceMotionEnabled())
237
241
  if (transition.kind == "none") return finishDismiss("programmatic")
242
+ // A fade-free exit does not animate alpha. If the fade-in was interrupted,
243
+ // the card would otherwise stay partly transparent and show the content
244
+ // behind it for the whole scale-out (OK-66647).
245
+ if (!transition.hidesOpacity) {
246
+ target.animatedView.alpha = 1f
247
+ }
238
248
  animate(target, hiddenState(target, transition), 0f, transition.motion) {
239
249
  if (phase == Phase.EXITING) finishDismiss("programmatic")
240
250
  }
@@ -392,6 +402,8 @@ class NativeOverlayView(
392
402
  backgroundColor = sheetBackgroundColor ?: defaultSheetBackgroundColor(),
393
403
  showHandle = showHandle,
394
404
  draggable = dismissOnPanDown,
405
+ bottomInsetColor = sheetBottomInsetColor,
406
+ bottomInsetHorizontalPx = (sheetBottomInsetHorizontal * density).toFloat(),
395
407
  )
396
408
  }
397
409
  }
@@ -145,6 +145,14 @@ class NativeOverlayViewManager :
145
145
  view.sheetBackgroundColor = value
146
146
  }
147
147
 
148
+ override fun setSheetBottomInsetColor(view: NativeOverlayView, value: Int?) {
149
+ view.sheetBottomInsetColor = value
150
+ }
151
+
152
+ override fun setSheetBottomInsetHorizontal(view: NativeOverlayView, value: Double) {
153
+ view.sheetBottomInsetHorizontal = value
154
+ }
155
+
148
156
  override fun setDismissOnPanDown(view: NativeOverlayView, value: Boolean) {
149
157
  view.dismissOnPanDown = value
150
158
  }
@@ -114,6 +114,48 @@ class NativeOverlayMotionTest {
114
114
  assertEquals(1, dismissals)
115
115
  }
116
116
 
117
+ @Test
118
+ fun fadeFreeExitSnapsAnInterruptedFadeInToFullOpacity() {
119
+ val activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
120
+ val reactContext = BridgeReactContext(activity)
121
+ reactContext.onHostResume(activity)
122
+ val context = ThemedReactContext(reactContext, activity, "OverlayMotionTest", 1)
123
+ val quick = """{"type":"spring","spring":{"mass":0.1,"stiffness":100,"damping":20}}"""
124
+ val overlay = NativeOverlayView(context).apply {
125
+ presentation = "center"
126
+ animationConfig = """
127
+ {"enter":{"type":"scale","scale":0.85,"fade":true,"motion":$quick},
128
+ "exit":{"type":"scale","scale":0.96,"fade":false,"motion":$quick},
129
+ "backdrop":{"motion":$quick}}
130
+ """.trimIndent()
131
+ addReactChild(View(context))
132
+ }
133
+ activity.setContentView(overlay)
134
+ overlay.visible = true
135
+ overlay.commitConfiguration()
136
+
137
+ val entryField = NativeOverlayView::class.java.getDeclaredField("entry").apply { isAccessible = true }
138
+ val entry = entryField.get(overlay) as NativeOverlayEntryRootView
139
+ val animatorField = NativeOverlayView::class.java.getDeclaredField("contentAnimator").apply { isAccessible = true }
140
+ val enterAnimator = animatorField.get(overlay) as ValueAnimator
141
+ // Freeze a frame of the running fade-in: closing now starts the exit from a
142
+ // partly transparent surface.
143
+ enterAnimator.currentPlayTime = enterAnimator.duration / 3
144
+ val interruptedAlpha = entry.animatedView.alpha
145
+ assertTrue(interruptedAlpha > 0f && interruptedAlpha < 1f)
146
+
147
+ overlay.visible = false
148
+ overlay.commitConfiguration()
149
+
150
+ // A fade-free exit must not start from the interrupted alpha: the card stays
151
+ // fully opaque while it scales out so the content behind it cannot show through.
152
+ assertEquals(1f, entry.animatedView.alpha, 0.001f)
153
+ val exitAnimator = animatorField.get(overlay) as ValueAnimator
154
+ assertEquals(292L, exitAnimator.duration)
155
+ exitAnimator.currentPlayTime = exitAnimator.duration / 3
156
+ assertEquals(1f, entry.animatedView.alpha, 0.001f)
157
+ }
158
+
117
159
  @Test
118
160
  fun finishingExitMovesTransitioningContentBackToStagingView() {
119
161
  val activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
@@ -0,0 +1,78 @@
1
+ package com.onekey.nativeoverlay
2
+
3
+ import android.graphics.Color
4
+ import android.graphics.drawable.ColorDrawable
5
+ import android.view.Gravity
6
+ import android.widget.FrameLayout
7
+ import androidx.activity.ComponentActivity
8
+ import com.facebook.react.bridge.BridgeReactContext
9
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
10
+ import com.facebook.react.uimanager.ThemedReactContext
11
+ import org.junit.Assert.assertEquals
12
+ import org.junit.Assert.assertNull
13
+ import org.junit.Assert.assertTrue
14
+ import org.junit.Test
15
+ import org.junit.runner.RunWith
16
+ import org.robolectric.Robolectric
17
+ import org.robolectric.RobolectricTestRunner
18
+ import org.robolectric.annotation.Config
19
+
20
+ @RunWith(RobolectricTestRunner::class)
21
+ @Config(sdk = [34])
22
+ class NativeOverlaySheetInsetTest {
23
+ private fun newEntry(): NativeOverlayEntryRootView {
24
+ ReactNativeFeatureFlagsForTests.setUp()
25
+ val activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
26
+ val reactContext = BridgeReactContext(activity)
27
+ val context = ThemedReactContext(reactContext, activity, "SheetInsetTest", 1)
28
+ return NativeOverlayEntryRootView(context)
29
+ }
30
+
31
+ @Test
32
+ fun paintsTheNavigationBarStripBehindTheContent() {
33
+ val entry = newEntry()
34
+ // Platform-painted sheet: the platform background reaches the inset.
35
+ entry.configureSheet(200, 24f, Color.WHITE, false, true)
36
+ assertNull(entry.sheetBottomInsetPaintView)
37
+ val sheet = entry.sheetView!!
38
+ val content = entry.contentView
39
+
40
+ entry.updateSheetBottomInsetPaint(48, Color.WHITE, 12f)
41
+
42
+ val paint = entry.sheetBottomInsetPaintView!!
43
+ assertTrue(sheet.indexOfChild(paint) < sheet.indexOfChild(content))
44
+ val params = paint.layoutParams as FrameLayout.LayoutParams
45
+ assertEquals(Gravity.BOTTOM, params.gravity)
46
+ assertEquals(12, params.leftMargin)
47
+ assertEquals(12, params.rightMargin)
48
+ // The inset plus a small overlap over the fractional content height.
49
+ assertTrue(params.height >= 48)
50
+ assertEquals(Color.WHITE, (paint.background as ColorDrawable).color)
51
+ }
52
+
53
+ @Test
54
+ fun clearsTheStripWhenThePlatformSheetPaintsTheSurface() {
55
+ val entry = newEntry()
56
+ entry.configureSheet(200, 24f, Color.TRANSPARENT, false, true)
57
+ val sheet = entry.sheetView!!
58
+ entry.updateSheetBottomInsetPaint(48, Color.WHITE, 0f)
59
+ assertTrue(sheet.childCount == 3)
60
+
61
+ entry.updateSheetBottomInsetPaint(48, null, 0f)
62
+
63
+ assertEquals(2, sheet.childCount)
64
+ assertNull(entry.sheetBottomInsetPaintView)
65
+ }
66
+
67
+ @Test
68
+ fun keepsTheStripSquareWhenTheSurfaceIsNarrowerThanTheSheet() {
69
+ val entry = newEntry()
70
+ entry.configureSheet(200, 24f, Color.TRANSPARENT, false, true)
71
+ entry.updateSheetBottomInsetPaint(48, Color.BLACK, 40f)
72
+
73
+ val params = entry.sheetBottomInsetPaintView!!.layoutParams as FrameLayout.LayoutParams
74
+ assertEquals(40, params.leftMargin)
75
+ assertEquals(40, params.rightMargin)
76
+ assertEquals(Gravity.BOTTOM, params.gravity)
77
+ }
78
+ }