@apexnative/navigation 1.0.0-alpha.2 → 1.0.0-alpha.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 (59) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/android/CLAUDE.md +21 -2
  3. package/android/CORE.md +3 -1
  4. package/android/src/main/java/dev/apexnative/navigation/NavigationActivity.kt +29 -1
  5. package/android/src/main/java/dev/apexnative/navigation/options/StatusBarOptions.kt +7 -3
  6. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/arrangement/SecondaryScreenPresenter.kt +13 -5
  7. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/bottomtabs/BottomTabsController.kt +76 -13
  8. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ComponentPresenter.kt +28 -7
  9. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/component/ScreenFrame.kt +1 -1
  10. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalAnimations.kt +22 -24
  11. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalCoordinator.kt +74 -8
  12. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalRecord.kt +21 -6
  13. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalSheet.kt +29 -12
  14. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/modal/ModalViews.kt +22 -18
  15. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/BackCallbackState.kt +4 -0
  16. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/Navigator.kt +41 -3
  17. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/navigator/RootCoordinator.kt +29 -6
  18. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/overlay/OverlayCoordinator.kt +2 -0
  19. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/ContainerBackground.kt +3 -3
  20. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/parent/ParentController.kt +3 -0
  21. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/sidemenu/SideMenuController.kt +4 -0
  22. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/splitview/SplitViewController.kt +14 -1
  23. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/BackPreview.kt +287 -0
  24. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackController.kt +148 -6
  25. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackDisplay.kt +24 -0
  26. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackQueue.kt +51 -11
  27. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackTransitions.kt +26 -8
  28. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/StackViews.kt +105 -2
  29. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/stack/topbar/TopBarPresenter.kt +121 -7
  30. package/android/src/main/java/dev/apexnative/navigation/viewcontrollers/viewcontroller/ViewController.kt +19 -0
  31. package/android/src/main/java/dev/apexnative/navigation/views/animations/Curves.kt +29 -11
  32. package/android/src/main/java/dev/apexnative/navigation/views/stack/ScreenEdge.kt +15 -0
  33. package/android/src/main/java/dev/apexnative/navigation/views/stack/StackLayout.kt +137 -1
  34. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TitleBar.kt +8 -1
  35. package/android/src/main/java/dev/apexnative/navigation/views/stack/topbar/TopBar.kt +26 -4
  36. package/docs-md/architecture/transitions.md +6 -0
  37. package/docs-md/containers/modals.md +4 -2
  38. package/docs-md/containers/overlays.md +3 -1
  39. package/docs-md/containers/side-menu.md +4 -2
  40. package/docs-md/containers/tabs.md +2 -0
  41. package/docs-md/flows/forms-in-a-modal.md +1 -1
  42. package/docs-md/help/glossary.md +1 -1
  43. package/docs-md/index.json +8 -0
  44. package/docs-md/screen-ui/back-and-gestures.md +6 -0
  45. package/docs-md/screen-ui/system-ui.md +1 -1
  46. package/lib/module/api/hooks/useNavigation.js +8 -3
  47. package/lib/module/api/hooks/useNavigation.js.map +1 -1
  48. package/lib/typescript/api/hooks/useNavigation.d.ts.map +1 -1
  49. package/lib/typescript/interfaces/options/animations.d.ts +10 -5
  50. package/lib/typescript/interfaces/options/animations.d.ts.map +1 -1
  51. package/lib/typescript/interfaces/options/modals.d.ts +18 -13
  52. package/lib/typescript/interfaces/options/modals.d.ts.map +1 -1
  53. package/lib/typescript/interfaces/options/system.d.ts +6 -3
  54. package/lib/typescript/interfaces/options/system.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/api/hooks/useNavigation.ts +8 -3
  57. package/src/interfaces/options/animations.ts +10 -5
  58. package/src/interfaces/options/modals.ts +18 -13
  59. package/src/interfaces/options/system.ts +6 -3
@@ -3,21 +3,25 @@
3
3
  * `'overCurrentContext'`, `'currentContext'` or `'popover'`. It is read once, when the modal shows, from the modal's
4
4
  * final options; `mergeOptions` afterwards doesn't change it, and neither does a change of theme or a rotation. Without
5
5
  * it the platform decides: on iOS the automatic style of UIKit (a sheet on iPhone, a card on iPad), on Android the
6
- * whole screen. An unknown string shows a full-screen modal on iOS and counts as not set on Android.
6
+ * whole screen, or the Material bottom sheet when `modal.sheet` is set. An unknown string shows a full-screen modal on
7
+ * iOS and counts as not set on Android.
7
8
  *
8
- * - `'pageSheet'`: (iOS) a sheet that leaves the screen below visible and pushed back; on iPad a wide card. Android
9
- * shows the whole screen, or the Material bottom sheet when `modal.sheet` is set.
10
- * - `'formSheet'`: (iOS) a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. Android
11
- * shows the whole screen, or the bottom sheet when `modal.sheet` is set.
12
- * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off. Both platforms treat the two
13
- * alike.
14
- * - `'overFullScreen'`, `'overCurrentContext'`: the whole screen with the screen below kept in place. It shows
15
- * through only where the modal screen is transparent (`layout.backgroundColor` and `layout.componentBackgroundColor`
16
- * both `'transparent'`); the style does not make anything transparent by itself.
9
+ * - `'pageSheet'`: a sheet that leaves the screen below visible. On iOS the screen below is pushed back, and on iPad
10
+ * the sheet is a wide card. On Android it is the Material modal bottom sheet over a dimmed screen, at the full height
11
+ * under the status bar (`modal.sheet` changes its stops), at most 640 dp wide and in the middle of a wider window.
12
+ * - `'formSheet'`: on iOS a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. On Android
13
+ * the same bottom sheet as `'pageSheet'`; `modal.contentSize` does nothing there.
14
+ * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off once the modal has come in.
15
+ * Both platforms treat the two alike. The modal comes up from the bottom: on Android with the system's motion of a
16
+ * window over another (300 ms up, 250 ms down), without a fade.
17
+ * - `'overFullScreen'`, `'overCurrentContext'`: the same, with the screen below kept in place under the modal. It
18
+ * shows through only where the modal screen is transparent (`layout.backgroundColor` and
19
+ * `layout.componentBackgroundColor` both `'transparent'`); the style does not make anything transparent by itself.
17
20
  * - `'popover'`: (iOS) a popover with an arrow on iPad, a sheet on iPhone unless `modal.popover.adaptive` is `false`.
18
- * Android has no popovers and shows the whole screen.
21
+ * Android has no popovers and shows the bottom sheet of `'pageSheet'`.
19
22
  *
20
- * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style.
23
+ * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style, and on
24
+ * Android with `'popover'` too.
21
25
  */
22
26
  export type OptionsModalPresentationStyle = 'pageSheet' | 'formSheet' | 'fullScreen' | 'overFullScreen' | 'overCurrentContext' | 'currentContext' | 'popover';
23
27
  /**
@@ -44,7 +48,8 @@ export type OptionsModalSheetDetent = 'medium' | 'large' | 'content' | number;
44
48
  /**
45
49
  * The settings of a sheet: a modal that comes from below and rests on one of several heights, its stops (detents). On
46
50
  * iOS they configure the system sheet of a modal presented as `'pageSheet'`, `'formSheet'` or without a style. On
47
- * Android any one of them turns the modal into a Material bottom sheet, again for those styles only. They are read when
51
+ * Android they configure the Material bottom sheet of `'pageSheet'`, `'formSheet'` and `'popover'`, and without a style
52
+ * any one of them turns the modal into that sheet. They are read when
48
53
  * the modal shows, and a `mergeOptions` on any screen of the modal changes them while it is shown, with an animation.
49
54
  * Objects merge key by key; `detents` is replaced as a whole.
50
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/options/modals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,6BAA6B,GACrC,WAAW,GACX,WAAW,GACX,YAAY,GACZ,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,GAChB,SAAS,CAAC;AAEd;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GACrC,eAAe,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACpC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,mCAAmC;AACnC,MAAM,MAAM,qBAAqB,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,mEAAmE;IACnE,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,mDAAmD;IACnD,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/options/modals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,6BAA6B,GACrC,WAAW,GACX,WAAW,GACX,YAAY,GACZ,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,GAChB,SAAS,CAAC;AAEd;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GACrC,eAAe,GAAG,eAAe,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,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MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -35,8 +35,9 @@ export interface OptionsLayout {
35
35
  * The color of the screen, also under its React content. On iOS it is the background of the screen's view (the
36
36
  * system background without it); stacks, tabs and side menus paint their view with the color of the screen that
37
37
  * shows, seen behind transparent bars and around screens during transitions. On Android it fills the screen and
38
- * its containers but leaves room at the top for the status bar while it shows. `null` makes the background
39
- * transparent. Without it, Android shows the window's background (the app theme).
38
+ * its containers but leaves room at the top for the status bar while it shows; without it a React screen takes
39
+ * `android:colorBackground` of the app's theme (in a sheet it shows the sheet's surface, and a native screen paints
40
+ * its own view), so the screen below never shows through. `null` makes the background transparent.
40
41
  */
41
42
  backgroundColor?: Color;
42
43
  /**
@@ -140,7 +141,9 @@ export interface OptionsStatusBar {
140
141
  * and buttons sits below the bar), and a screen without a top bar starts below the bar. `true` lets a screen without
141
142
  * a top bar start at the top of the window, with its safe area keeping content below. `false` starts the top bar
142
143
  * below the status bar, which keeps its own color. A sheet modal has no status bar above it, so this does not apply
143
- * there. On iOS the screen is always under the status bar and the safe area keeps the content below.
144
+ * there. An overlay covers the whole window, so its screens go under the status bar without it (a dimmed backdrop
145
+ * dims the status bar too), and `false`, in its options or in the default options, starts them below. On iOS the
146
+ * screen is always under the status bar and the safe area keeps the content below.
144
147
  */
145
148
  drawBehind?: boolean;
146
149
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/options/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAU,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,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GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qHAAqH;AACrH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAEjG;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,8FAA8F;IAC9F,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,+GAA+G;IAC/G,SAAS,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/options/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAU,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,SAAS,GACT,UAAU,GACV,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,gBAAgB,CAAC;AAErB;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,KAAK,CAAC;IACjC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC;;;;;;OAMG;IACH,Y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,EAAE,yBAAyB,EAAE,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexnative/navigation",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "Native navigation for React Native: platform stacks, tabs, modals and side menus on iOS, iPadOS and Android",
5
5
  "keywords": [
6
6
  "react-native",
@@ -177,14 +177,19 @@ function stackCommands(id: string): StackCommands {
177
177
  };
178
178
  }
179
179
 
180
- /** The commands of the center for a menu screen: the menu closes once the center has changed. */
180
+ /**
181
+ * The commands of the center for a menu screen: the menu closes as the center changes, and the command resolves once
182
+ * both are done.
183
+ */
181
184
  function fromCenter(center: string, menuScreen: string): StackCommands {
182
185
  const centerCommands = stackCommands(center);
186
+ // As in the system's apps, the menu starts to close at the pick and the center changes as it goes, so a push is seen
187
+ // sliding in. The command settles after both, so the next one acts from the center; either one's error rejects it.
183
188
  const closing =
184
189
  <Args extends unknown[], Result>(run: (...args: Args) => Promise<Result>) =>
185
190
  async (...args: Args) => {
186
- const result = await run(...args);
187
- await closeMenu(menuScreen);
191
+ const closed = closeMenu(menuScreen);
192
+ const [result] = await Promise.all([run(...args), closed]);
188
193
  return result;
189
194
  };
190
195
  return {
@@ -361,15 +361,18 @@ export interface StackAnimationOptions {
361
361
  /**
362
362
  * The animation of the screens: `enter` for the screen that comes (on a pop, the one that was below), `exit` for the
363
363
  * one that goes. A property with a `from` or a `to` makes it an animation of its own, which replaces the platform's
364
- * transition; the side left out stays still. (Android) With one of its own, the title and buttons of the bar and the
365
- * tab bar don't travel with the screens. (Android) When the transition has elements, a push plays only `enter` and a
364
+ * transition; the side left out stays still. With one of its own, (Android) the top bar goes with its screen: the
365
+ * bar of the screen that goes leaves with it, and the bar of the screen that comes moves, scales and fades with it;
366
+ * (iOS) UIKit keeps the bar in place and changes its title and buttons at once. (Android) The tab bar doesn't travel
367
+ * with the screens. (Android) When the transition has elements, a push plays only `enter` and a
366
368
  * pop only `exit`, and only when that side is a single `alpha`; any other side is not played, and the screen fades in
367
369
  * or out in 300 ms around the elements instead. iOS plays the sides as they are set.
368
370
  */
369
371
  content?: EnterExitAnimationOptions;
370
372
  /**
371
373
  * (Android) The animation of the top bar when it shows or hides because the screens differ in `topBar.visible`.
372
- * Without it, the bar slides up by its height and back in 300 ms. iOS animates the bar with UIKit.
374
+ * Without it, the bar slides up by its height and back in 300 ms; with a `content` of its own it shows or hides
375
+ * with its screen. iOS animates the bar with UIKit.
373
376
  */
374
377
  topBar?: EnterExitAnimationOptions<TopBarAnimationOptions>;
375
378
  /**
@@ -420,8 +423,10 @@ export interface SetStackRootAnimationOptions extends StackAnimationOptions {
420
423
  * screen under it. The screen under a modal takes part (iOS) only under a modal that covers the full screen.
421
424
  *
422
425
  * A sheet keeps the system's sheet motion on both platforms: (iOS) a modal shown as `'pageSheet'`, `'formSheet'` or
423
- * without a style, (Android) a Material bottom sheet. The sides `enter` and `exit` and the lists of elements set here
424
- * don't apply to it.
426
+ * without a style, (Android) the Material bottom sheet of `'pageSheet'`, `'formSheet'`, `'popover'`, or of
427
+ * `modal.sheet` without a style. The sides `enter` and `exit` and the lists of elements set here don't apply to it.
428
+ * Without them a modal over the whole screen comes up from the bottom: on iOS by UIKit's `modalTransitionStyle`, on
429
+ * Android with the system's motion of a window over another, 300 ms up and 250 ms down, without a fade.
425
430
  *
426
431
  * (Android) When the modal has elements, `enter` of a show and `exit` of a dismiss play only when that side is a single
427
432
  * `alpha`; any other side is not played, and the modal fades in or out in 300 ms around the elements instead.
@@ -3,21 +3,25 @@
3
3
  * `'overCurrentContext'`, `'currentContext'` or `'popover'`. It is read once, when the modal shows, from the modal's
4
4
  * final options; `mergeOptions` afterwards doesn't change it, and neither does a change of theme or a rotation. Without
5
5
  * it the platform decides: on iOS the automatic style of UIKit (a sheet on iPhone, a card on iPad), on Android the
6
- * whole screen. An unknown string shows a full-screen modal on iOS and counts as not set on Android.
6
+ * whole screen, or the Material bottom sheet when `modal.sheet` is set. An unknown string shows a full-screen modal on
7
+ * iOS and counts as not set on Android.
7
8
  *
8
- * - `'pageSheet'`: (iOS) a sheet that leaves the screen below visible and pushed back; on iPad a wide card. Android
9
- * shows the whole screen, or the Material bottom sheet when `modal.sheet` is set.
10
- * - `'formSheet'`: (iOS) a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. Android
11
- * shows the whole screen, or the bottom sheet when `modal.sheet` is set.
12
- * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off. Both platforms treat the two
13
- * alike.
14
- * - `'overFullScreen'`, `'overCurrentContext'`: the whole screen with the screen below kept in place. It shows
15
- * through only where the modal screen is transparent (`layout.backgroundColor` and `layout.componentBackgroundColor`
16
- * both `'transparent'`); the style does not make anything transparent by itself.
9
+ * - `'pageSheet'`: a sheet that leaves the screen below visible. On iOS the screen below is pushed back, and on iPad
10
+ * the sheet is a wide card. On Android it is the Material modal bottom sheet over a dimmed screen, at the full height
11
+ * under the status bar (`modal.sheet` changes its stops), at most 640 dp wide and in the middle of a wider window.
12
+ * - `'formSheet'`: on iOS a sheet on iPhone, a card in the middle on iPad whose size is `modal.contentSize`. On Android
13
+ * the same bottom sheet as `'pageSheet'`; `modal.contentSize` does nothing there.
14
+ * - `'fullScreen'`, `'currentContext'`: the whole screen; the screen below is taken off once the modal has come in.
15
+ * Both platforms treat the two alike. The modal comes up from the bottom: on Android with the system's motion of a
16
+ * window over another (300 ms up, 250 ms down), without a fade.
17
+ * - `'overFullScreen'`, `'overCurrentContext'`: the same, with the screen below kept in place under the modal. It
18
+ * shows through only where the modal screen is transparent (`layout.backgroundColor` and
19
+ * `layout.componentBackgroundColor` both `'transparent'`); the style does not make anything transparent by itself.
17
20
  * - `'popover'`: (iOS) a popover with an arrow on iPad, a sheet on iPhone unless `modal.popover.adaptive` is `false`.
18
- * Android has no popovers and shows the whole screen.
21
+ * Android has no popovers and shows the bottom sheet of `'pageSheet'`.
19
22
  *
20
- * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style.
23
+ * The options of the sheet (`modal.sheet`) apply with `'pageSheet'`, `'formSheet'` and without a style, and on
24
+ * Android with `'popover'` too.
21
25
  */
22
26
  export type OptionsModalPresentationStyle =
23
27
  | 'pageSheet'
@@ -55,7 +59,8 @@ export type OptionsModalSheetDetent = 'medium' | 'large' | 'content' | number;
55
59
  /**
56
60
  * The settings of a sheet: a modal that comes from below and rests on one of several heights, its stops (detents). On
57
61
  * iOS they configure the system sheet of a modal presented as `'pageSheet'`, `'formSheet'` or without a style. On
58
- * Android any one of them turns the modal into a Material bottom sheet, again for those styles only. They are read when
62
+ * Android they configure the Material bottom sheet of `'pageSheet'`, `'formSheet'` and `'popover'`, and without a style
63
+ * any one of them turns the modal into that sheet. They are read when
59
64
  * the modal shows, and a `mergeOptions` on any screen of the modal changes them while it is shown, with an animation.
60
65
  * Objects merge key by key; `detents` is replaced as a whole.
61
66
  */
@@ -46,8 +46,9 @@ export interface OptionsLayout {
46
46
  * The color of the screen, also under its React content. On iOS it is the background of the screen's view (the
47
47
  * system background without it); stacks, tabs and side menus paint their view with the color of the screen that
48
48
  * shows, seen behind transparent bars and around screens during transitions. On Android it fills the screen and
49
- * its containers but leaves room at the top for the status bar while it shows. `null` makes the background
50
- * transparent. Without it, Android shows the window's background (the app theme).
49
+ * its containers but leaves room at the top for the status bar while it shows; without it a React screen takes
50
+ * `android:colorBackground` of the app's theme (in a sheet it shows the sheet's surface, and a native screen paints
51
+ * its own view), so the screen below never shows through. `null` makes the background transparent.
51
52
  */
52
53
  backgroundColor?: Color;
53
54
  /**
@@ -152,7 +153,9 @@ export interface OptionsStatusBar {
152
153
  * and buttons sits below the bar), and a screen without a top bar starts below the bar. `true` lets a screen without
153
154
  * a top bar start at the top of the window, with its safe area keeping content below. `false` starts the top bar
154
155
  * below the status bar, which keeps its own color. A sheet modal has no status bar above it, so this does not apply
155
- * there. On iOS the screen is always under the status bar and the safe area keeps the content below.
156
+ * there. An overlay covers the whole window, so its screens go under the status bar without it (a dimmed backdrop
157
+ * dims the status bar too), and `false`, in its options or in the default options, starts them below. On iOS the
158
+ * screen is always under the status bar and the safe area keeps the content below.
156
159
  */
157
160
  drawBehind?: boolean;
158
161
  /**