@momo-kits/native-kits 0.169.10-beta.1 → 0.169.10-beta.1-debug

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 (140) hide show
  1. package/build.gradle.kts +11 -0
  2. package/compose/build.gradle.kts +198 -0
  3. package/compose/compose.podspec +47 -0
  4. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  10. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +267 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +482 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +224 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +195 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +263 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +280 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +40 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +363 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +307 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +88 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +306 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +457 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +205 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +120 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +210 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +292 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +67 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +316 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +397 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +118 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +205 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +747 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +242 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +400 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +100 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +207 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +132 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +446 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +398 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +197 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +22 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
  124. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  125. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  126. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +218 -0
  130. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  131. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +144 -0
  132. package/gradle/libs.versions.toml +67 -0
  133. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  134. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  135. package/gradle.properties +24 -0
  136. package/gradlew +252 -0
  137. package/gradlew.bat +94 -0
  138. package/ios-demo/README.md +120 -0
  139. package/package.json +1 -1
  140. package/settings.gradle.kts +64 -0
@@ -0,0 +1,747 @@
1
+ package vn.momo.kits.navigation
2
+
3
+ import androidx.compose.animation.animateColorAsState
4
+ import androidx.compose.animation.core.Animatable
5
+ import androidx.compose.animation.core.AnimationVector1D
6
+ import androidx.compose.animation.core.tween
7
+ import androidx.compose.foundation.ScrollState
8
+ import androidx.compose.foundation.background
9
+ import androidx.compose.foundation.border
10
+ import androidx.compose.foundation.gestures.ScrollableState
11
+ import androidx.compose.foundation.gestures.animateScrollBy
12
+ import androidx.compose.foundation.layout.Box
13
+ import androidx.compose.foundation.layout.Column
14
+ import androidx.compose.foundation.layout.ColumnScope
15
+ import androidx.compose.foundation.layout.Spacer
16
+ import androidx.compose.foundation.layout.WindowInsets
17
+ import androidx.compose.foundation.layout.asPaddingValues
18
+ import androidx.compose.foundation.layout.aspectRatio
19
+ import androidx.compose.foundation.layout.fillMaxSize
20
+ import androidx.compose.foundation.layout.fillMaxWidth
21
+ import androidx.compose.foundation.layout.height
22
+ import androidx.compose.foundation.layout.ime
23
+ import androidx.compose.foundation.layout.imePadding
24
+ import androidx.compose.foundation.layout.offset
25
+ import androidx.compose.foundation.layout.padding
26
+ import androidx.compose.foundation.layout.width
27
+ import androidx.compose.foundation.lazy.LazyListState
28
+ import androidx.compose.foundation.rememberScrollState
29
+ import androidx.compose.foundation.verticalScroll
30
+ import androidx.compose.material.ExperimentalMaterialApi
31
+ import androidx.compose.runtime.Composable
32
+ import androidx.compose.runtime.CompositionLocalProvider
33
+ import androidx.compose.foundation.layout.PaddingValues
34
+ import androidx.compose.runtime.LaunchedEffect
35
+ import androidx.compose.runtime.State
36
+ import androidx.compose.runtime.getValue
37
+ import androidx.compose.runtime.mutableIntStateOf
38
+ import androidx.compose.runtime.mutableStateOf
39
+ import androidx.compose.runtime.remember
40
+ import androidx.compose.runtime.rememberUpdatedState
41
+ import androidx.compose.runtime.snapshotFlow
42
+ import androidx.compose.runtime.staticCompositionLocalOf
43
+ import androidx.compose.ui.Alignment
44
+ import androidx.compose.ui.Modifier
45
+ import androidx.compose.ui.graphics.Brush
46
+ import androidx.compose.ui.graphics.Color
47
+ import androidx.compose.ui.graphics.graphicsLayer
48
+ import androidx.compose.ui.graphics.lerp
49
+ import androidx.compose.ui.layout.onGloballyPositioned
50
+ import androidx.compose.ui.platform.LocalDensity
51
+ import androidx.compose.ui.unit.Dp
52
+ import androidx.compose.ui.unit.dp
53
+ import androidx.compose.ui.unit.lerp
54
+ import androidx.compose.ui.zIndex
55
+ import kotlinx.coroutines.flow.Flow
56
+ import kotlinx.coroutines.flow.filter
57
+ import kotlinx.coroutines.launch
58
+ import vn.momo.kits.components.InputSearch
59
+ import vn.momo.kits.components.InputSearchSize
60
+ import vn.momo.kits.const.AppNavigationBar
61
+ import vn.momo.kits.const.AppTheme
62
+ import vn.momo.kits.application.IsShowBaseLineDebug
63
+ import vn.momo.kits.const.Colors
64
+ import vn.momo.kits.const.Spacing
65
+ import vn.momo.kits.modifier.conditional
66
+ import vn.momo.kits.modifier.hideKeyboardOnTap
67
+ import vn.momo.kits.navigation.component.FABPosition
68
+ import vn.momo.kits.navigation.component.FloatingButton
69
+ import vn.momo.kits.navigation.component.HEADER_HEIGHT
70
+ import vn.momo.kits.navigation.component.Header
71
+ import vn.momo.kits.navigation.component.HeaderBackground
72
+ import vn.momo.kits.navigation.component.HeaderRight
73
+ import vn.momo.kits.navigation.component.HeaderSideBar
74
+ import vn.momo.kits.navigation.bottomtab.LocalDuoRailReserve
75
+ import vn.momo.kits.navigation.bottomtab.LocalTabBarHasCenterAction
76
+ import vn.momo.kits.navigation.bottomtab.duoFloatingTabBarInset
77
+ import vn.momo.kits.navigation.component.HeaderType
78
+ import vn.momo.kits.navigation.component.InputSearchType
79
+ import vn.momo.kits.navigation.bottomtab.LocalBottomTabFocused
80
+ import vn.momo.kits.platform.BackHandler
81
+ import vn.momo.kits.platform.supportsImePadding
82
+ import vn.momo.kits.navigation.tracking.ScreenTracker
83
+ import vn.momo.kits.navigation.tracking.ScreenTrackingState
84
+ import kotlinx.coroutines.delay
85
+ import vn.momo.kits.application.LocalContext
86
+ import vn.momo.kits.utils.horizontalSafeAreaPadding
87
+ import vn.momo.kits.layout.LocalScreenLayout
88
+ import vn.momo.kits.layout.ScreenLayout
89
+ import vn.momo.kits.layout.consumeHorizontalInsets
90
+ import vn.momo.kits.layout.HEADER_BANNER_WIDTH
91
+ import vn.momo.kits.layout.HEADER_BUTTON_SIZE
92
+ import vn.momo.kits.layout.HEADER_TITLE_GAP
93
+ import vn.momo.kits.layout.getScreenLayout
94
+ import vn.momo.kits.layout.rememberHeaderLayout
95
+ import kotlin.time.Clock
96
+ import kotlin.time.Duration.Companion.milliseconds
97
+ import kotlin.time.ExperimentalTime
98
+
99
+ @Composable
100
+ fun floatingTabBarContentPadding(): PaddingValues {
101
+ val navigation = LocalNavigation.current
102
+ LaunchedEffect(navigation) { navigation.bottomTabEdgeToEdge = true }
103
+ val reserve = navigation.bottomTabIndex != -1 && navigation.bottomTabEdgeToEdge
104
+ return PaddingValues(bottom = if (reserve) bottomTabChildInset() else 0.dp)
105
+ }
106
+
107
+ internal val LocalFooterHeightPx = staticCompositionLocalOf { mutableIntStateOf(0) }
108
+ internal val LocalHeaderRightWidthPx = staticCompositionLocalOf { mutableIntStateOf(0) }
109
+
110
+ // Space a tab's content leaves for the tab bar and home indicator: the horizontal bar floats over the
111
+ // content (phone and unfolded Duo); the Duo rail lives in the side strip, so only the home indicator.
112
+ @Composable
113
+ private fun bottomTabChildInset(): Dp {
114
+ val keyboard = keyboardSizeState().value
115
+ val navigationBar = AppNavigationBar.current
116
+ val layout = getScreenLayout()
117
+ return when {
118
+ layout.isIPhoneDuo && layout.sideBar != null -> (navigationBar - keyboard).coerceAtLeast(0.dp)
119
+ else -> (duoFloatingTabBarInset(layout, LocalTabBarHasCenterAction.current) - keyboard).coerceAtLeast(0.dp)
120
+ }
121
+ }
122
+
123
+ @OptIn(ExperimentalMaterialApi::class, ExperimentalTime::class)
124
+ @Composable
125
+ internal fun StackScreen(
126
+ content: @Composable () -> Unit,
127
+ navigationOptions: NavigationOptions? = null,
128
+ id: Int = -1,
129
+ name: String = "",
130
+ bottomTabIndex: Int = -1,
131
+ onBackHandler: (() -> Unit)? = null,
132
+ ) {
133
+ val navigator = LocalNavigator.current
134
+ val maxApi = LocalMaxApi.current
135
+ val context = LocalContext.current
136
+ val screenLayout = getScreenLayout()
137
+ val density = LocalDensity.current
138
+ val screenRegistry = LocalDynamicScreenRegistry.current
139
+ val navigation = remember { Navigation(id = id, bottomTabIndex = bottomTabIndex, initOptions = navigationOptions, registry = screenRegistry) }
140
+
141
+ val options by navigation.currentOptions
142
+ val isBottomTabChild = bottomTabIndex != -1
143
+ val isBottomTabRoot = navigation.isBottomTabRoot
144
+
145
+ // A mounted-but-hidden bottom tab tracks again each time it is focused (RN useFocusEffect).
146
+ val tabFocused = LocalBottomTabFocused.current
147
+
148
+ val trackingState = remember(tabFocused) {
149
+ ScreenTrackingState().apply {
150
+ time = Clock.System.now().toEpochMilliseconds()
151
+ }
152
+ }
153
+
154
+ val action = remember(tabFocused) {
155
+ if (ScreenTracker.getLastScreenName() != null) "push" else "back"
156
+ }
157
+
158
+ LaunchedEffect(name, tabFocused) {
159
+ if (!tabFocused) return@LaunchedEffect
160
+ ScreenTracker.trackScreenNavigated(
161
+ maxApi = maxApi,
162
+ context = context,
163
+ screenName = name,
164
+ action = action,
165
+ state = trackingState
166
+ )
167
+
168
+ delay(2000.milliseconds)
169
+ val loadTime = Clock.System.now().toEpochMilliseconds() - trackingState.time
170
+ ScreenTracker.trackScreenDisplayed(
171
+ maxApi = maxApi,
172
+ context = context,
173
+ screenName = name,
174
+ duration = loadTime,
175
+ state = trackingState
176
+ )
177
+
178
+ val interactionTime = Clock.System.now().toEpochMilliseconds() - trackingState.time
179
+ ScreenTracker.trackScreenInteracted(
180
+ maxApi = maxApi,
181
+ context = context,
182
+ screenName = name,
183
+ duration = interactionTime - loadTime,
184
+ totalDuration = interactionTime,
185
+ state = trackingState
186
+ )
187
+ }
188
+
189
+ val limit = with(density) {
190
+ screenLayout.headerHeight.toPx()
191
+ }.toInt()
192
+
193
+ val lazyListState = options.scrollData.scrollState as? LazyListState
194
+ val (scrollState, _) = if (lazyListState != null)
195
+ lazyListState.proxyScrollState(limit, 1)
196
+ else
197
+ (options.scrollData.scrollState as? ScrollState ?: rememberScrollState()).proxyLimitedScrollState(limit, 1)
198
+ val snapState: ScrollableState = lazyListState ?: scrollState
199
+ val headerHide = rememberQuickReturnHide(
200
+ enabled = options.usesDuoQuickReturnHeader(screenLayout),
201
+ scrollState = scrollState,
202
+ heightPx = with(density) { screenLayout.headerHeight.toPx() },
203
+ )
204
+
205
+ val footerHeightPx = remember { mutableIntStateOf(0) }
206
+ val headerRightWidthPx = remember { mutableIntStateOf(0) }
207
+
208
+ if (tabFocused && navigation.options.scrollData.scrollToTopCallback != null) {
209
+ RegisterScrollToTop(navigation.options.scrollData.scrollToTopCallback)
210
+ }
211
+
212
+ val canPop = navigator.canPop()
213
+
214
+ val hasCustomBackHandling = !SwipeBackConfig.enabled ||
215
+ OverplayComponentRegistry.isOverplayShowing() ||
216
+ !canPop
217
+
218
+ BackHandler(hasCustomBackHandling) { navigator.onBackSafe() }
219
+
220
+ CompositionLocalProvider(
221
+ StackScreenScrollableState provides options.scrollData.scrollState,
222
+ LocalNavigation provides navigation,
223
+ LocalScrollState provides scrollState,
224
+ LocalOptions provides options,
225
+ LocalFooterHeightPx provides footerHeightPx,
226
+ LocalHeaderRightWidthPx provides headerRightWidthPx
227
+ ) {
228
+ Box(Modifier.fillMaxSize()) {
229
+ options.backgroundComponent?.let { background ->
230
+ Box(Modifier.fillMaxSize()) { background() }
231
+ }
232
+ Box(
233
+ Modifier
234
+ .fillMaxSize()
235
+ .background(
236
+ if (options.backgroundComponent != null) Color.Transparent
237
+ else options.backgroundColor ?: AppTheme.current.colors.background.default
238
+ )
239
+ .conditional(options.keyboardOptions.keyboardShouldPersistTaps) {
240
+ hideKeyboardOnTap()
241
+ }
242
+ .conditional(options.keyboardOptions.useAvoidKeyboard && supportsImePadding()) {
243
+ imePadding()
244
+ }
245
+ ) {
246
+ Box(Modifier.zIndex(1f)) {
247
+ HeaderBackground()
248
+ }
249
+
250
+ Box(Modifier.zIndex(4f).graphicsLayer { translationY = -headerHide.value }) {
251
+ Header(onBackHandler)
252
+ }
253
+
254
+ HeaderSideBar(
255
+ bottomInset = maxOf(
256
+ bottomBarsHeight(isBottomTabChild) + Spacing.XL,
257
+ if (isBottomTabChild) LocalDuoRailReserve.current else 0.dp,
258
+ ),
259
+ modifier = Modifier.zIndex(4f),
260
+ )
261
+
262
+ Column(Modifier.zIndex(5f).horizontalSafeAreaPadding()) {
263
+ SearchAnimated(snapState = snapState)
264
+ }
265
+
266
+ Column(Modifier.zIndex(2f).fillMaxSize()) {
267
+ MainContent(content = content, isBottomTabRoot = isBottomTabRoot, isBottomTabChild = isBottomTabChild)
268
+ FooterContent()
269
+ }
270
+
271
+ Box(Modifier.zIndex(6f).horizontalSafeAreaPadding()) {
272
+ FloatingContent(isBottomTabChild = isBottomTabChild)
273
+ }
274
+
275
+ OverplayView(isBottomTabChild = isBottomTabChild, id = id)
276
+ }
277
+ }
278
+ }
279
+ }
280
+
281
+ // Height the footer, tab bar or home indicator takes from the bottom of the screen.
282
+ @Composable
283
+ private fun bottomBarsHeight(isBottomTabChild: Boolean): Dp {
284
+ val options = LocalOptions.current
285
+ val navigationBar = AppNavigationBar.current
286
+ return when {
287
+ options.hasFooter() -> with(LocalDensity.current) { LocalFooterHeightPx.current.intValue.toDp() }
288
+ isBottomTabChild -> bottomTabChildInset()
289
+ else -> navigationBar
290
+ }
291
+ }
292
+
293
+ @Suppress("FrequentlyChangingValue")
294
+ @Composable
295
+ internal fun FloatingContent(isBottomTabChild: Boolean) {
296
+ val options = LocalOptions.current
297
+ val scrollState = LocalScrollState.current
298
+
299
+ val fabProps = options.floatingButtonProps ?: return
300
+ val bottomPadding = fabProps.bottom ?: (Spacing.M + bottomBarsHeight(isBottomTabChild))
301
+
302
+ FloatingButton(
303
+ scrollPosition = fabProps.scrollState?.value ?: scrollState.value,
304
+ onClick = fabProps.onClick,
305
+ containerColor = AppTheme.current.colors.primary,
306
+ bottom = bottomPadding,
307
+ icon = fabProps.icon,
308
+ iconColor = fabProps.iconColor,
309
+ text = fabProps.label,
310
+ size = fabProps.size,
311
+ position = fabProps.position ?: FABPosition.END,
312
+ )
313
+ }
314
+
315
+ @Composable
316
+ internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTabRoot: Boolean, isBottomTabChild: Boolean) {
317
+ val options = LocalOptions.current
318
+ val inputSearchType = getInputSearchType(options)
319
+ val density = LocalDensity.current
320
+ val scrollState = LocalScrollState.current
321
+ val navigationBar = AppNavigationBar.current
322
+ val screenLayout = getScreenLayout()
323
+ val useDuoGlass = options.usesDuoGlassHeader(screenLayout)
324
+
325
+ Spacer(
326
+ Modifier.height(
327
+ if (!useDuoGlass && (options.headerType is HeaderType.DefaultOrExtended || (options.headerType is HeaderType.Transparent && !options.headerType.isFullScreenContent)))
328
+ screenLayout.headerHeight else 0.dp
329
+ )
330
+ )
331
+ if (inputSearchType == InputSearchType.Animated) {
332
+ val scrollDp = with(density) { scrollState.value.toDp() }
333
+
334
+ Spacer(Modifier.height((HEADER_HEIGHT.dp - scrollDp).coerceIn(0.dp, HEADER_HEIGHT.dp)))
335
+ }
336
+ val insetContent = !isBottomTabRoot
337
+ Column(
338
+ Modifier
339
+ .fillMaxWidth()
340
+ .weight(1f)
341
+ .conditional(insetContent && options.headerType !is HeaderType.Animated) {
342
+ horizontalSafeAreaPadding()
343
+ }
344
+ .conditional(options.scrollData.scrollable && options.scrollData.scrollState is ScrollState) {
345
+ verticalScroll(scrollState)
346
+ }
347
+ .conditional(useDuoGlass) {
348
+ padding(top = screenLayout.headerHeight)
349
+ }
350
+ .padding(
351
+ bottom = when {
352
+ options.hasFooter() || isBottomTabRoot -> 0.dp
353
+ // 0 when the tab pads itself via floatingTabBarContentPadding(), else the kit reserves the bar space
354
+ isBottomTabChild -> if (LocalNavigation.current.bottomTabEdgeToEdge) 0.dp else bottomTabChildInset()
355
+ !options.scrollData.scrollable && options.scrollData.scrollState == null -> 0.dp
356
+ else -> navigationBar
357
+ }
358
+ )
359
+ ) {
360
+ ScreenContent(content = content, insetContent = insetContent)
361
+ }
362
+
363
+ }
364
+
365
+ @Composable
366
+ internal fun ScreenContent(content: @Composable () -> Unit, insetContent: Boolean) {
367
+ val scrollState = LocalScrollState.current
368
+ val options = LocalOptions.current
369
+ val screenLayout = getScreenLayout()
370
+ val insetBody: @Composable () -> Unit = {
371
+ CompositionLocalProvider(
372
+ LocalScreenLayout provides if (insetContent) screenLayout.consumeHorizontalInsets() else screenLayout,
373
+ content = content,
374
+ )
375
+ }
376
+
377
+ if (options.headerType is HeaderType.Animated) {
378
+ val animatedHeader = options.headerType
379
+ val isBannerCentered = rememberHeaderLayout(options.contentLayout).isBannerCentered
380
+ Box {
381
+ // wide windows and the iPhone Duo inner display keep the phone banner size, centered over
382
+ // a fill fading down from bannerBackgroundColor
383
+ val bannerWidth = if (isBannerCentered) Modifier.width(HEADER_BANNER_WIDTH) else Modifier.fillMaxWidth()
384
+ val bannerModifier = animatedHeader.height
385
+ ?.let { bannerWidth.height(it) }
386
+ ?: bannerWidth.aspectRatio(animatedHeader.aspectRatio.value)
387
+ Box(Modifier.fillMaxWidth(), contentAlignment = Alignment.TopCenter) {
388
+ val fill = animatedHeader.bannerBackgroundColor
389
+ if (isBannerCentered && fill != null) {
390
+ Box(
391
+ Modifier.matchParentSize()
392
+ .background(Brush.verticalGradient(listOf(fill, fill.copy(alpha = 0f))))
393
+ )
394
+ }
395
+ Box(bannerModifier) {
396
+ animatedHeader.composable.invoke(scrollState.value)
397
+ }
398
+ }
399
+ Box(
400
+ Modifier
401
+ .padding(top = screenLayout.headerHeight + animatedHeader.layoutOffSet)
402
+ .conditional(insetContent) { horizontalSafeAreaPadding() }
403
+ ) {
404
+ insetBody()
405
+ }
406
+ }
407
+ } else {
408
+ insetBody()
409
+ }
410
+ }
411
+
412
+ @Composable
413
+ internal fun FooterContent() {
414
+ val options = LocalOptions.current
415
+ if (options.hasFooter()) {
416
+ val keyboardSize = keyboardSizeState()
417
+ // the floating tab bar overlays tab content, so a tab's footer sits above it
418
+ val duoTabInset = if (LocalNavigation.current.bottomTabIndex != -1) duoFloatingTabBarInset(getScreenLayout(), LocalTabBarHasCenterAction.current) else 0.dp
419
+ val bottomPadding = (maxOf(AppNavigationBar.current, duoTabInset) - keyboardSize.value).coerceAtLeast(0.dp)
420
+ Footer(
421
+ footerComponent = options.footerComponent,
422
+ bottomPadding = bottomPadding,
423
+ transparent = options.footerTransparent,
424
+ useMargin = options.footerUseMargin
425
+ )
426
+ }
427
+ }
428
+
429
+ @Composable
430
+ internal fun keyboardSizeState(): State<Dp> {
431
+ val bottom = WindowInsets.ime.asPaddingValues()
432
+ return rememberUpdatedState(bottom.calculateBottomPadding())
433
+ }
434
+
435
+ @Composable
436
+ internal fun OverplayView(isBottomTabChild: Boolean, id: Int) {
437
+ val overplayType = OverplayComponentRegistry.getOverplayType()
438
+
439
+ if (overplayType != null) {
440
+ Box(Modifier.zIndex(if (overplayType == OverplayComponentType.SNACK_BAR) 3f else 7f).fillMaxSize()) {
441
+ if (isBottomTabChild) return@Box
442
+ if (OverplayComponentRegistry.currentRootId() != id) return@Box
443
+ OverplayComponentRegistry.OverlayComponent()
444
+ }
445
+ }
446
+ }
447
+
448
+ @Composable
449
+ fun Footer(
450
+ footerComponent: @Composable (() -> Unit)?,
451
+ bottomPadding: Dp,
452
+ transparent: Boolean = false,
453
+ useMargin: Boolean = true,
454
+ ) {
455
+ if (footerComponent == null) return
456
+
457
+ val footerHeightPx = LocalFooterHeightPx.current
458
+
459
+ val shadowBrush = remember {
460
+ Brush.verticalGradient(
461
+ colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.05f))
462
+ )
463
+ }
464
+
465
+ val backgroundColor = if (transparent) Color.Transparent else AppTheme.current.colors.background.surface
466
+
467
+ // inset as a whole, not padded inside, so the surface and its shadow stay off the iPhone Duo side bar
468
+ Box(Modifier.onGloballyPositioned {
469
+ if (footerHeightPx.intValue != it.size.height) footerHeightPx.intValue = it.size.height
470
+ }.horizontalSafeAreaPadding()) {
471
+ Box(
472
+ Modifier
473
+ .fillMaxWidth()
474
+ .background(backgroundColor)
475
+ .conditional(IsShowBaseLineDebug) {
476
+ border(1.dp, Colors.blue_03)
477
+ }
478
+ .padding(
479
+ top = if (useMargin) Spacing.S else 0.dp,
480
+ start = if (useMargin) Spacing.M else 0.dp,
481
+ end = if (useMargin) Spacing.M else 0.dp,
482
+ bottom = bottomPadding + if (useMargin) Spacing.S else 0.dp,
483
+ )
484
+ ) {
485
+ footerComponent.invoke()
486
+ }
487
+
488
+ if (!transparent) {
489
+ Box(
490
+ modifier = Modifier
491
+ .fillMaxWidth()
492
+ .height(6.dp)
493
+ .offset(x = 0.dp, y = (-6).dp)
494
+ .background(shadowBrush)
495
+ )
496
+ }
497
+ }
498
+ }
499
+
500
+ data class InputSearchLayoutParams(
501
+ val topPadding: Dp,
502
+ val startPadding: Dp,
503
+ val endPadding: Dp
504
+ )
505
+
506
+ @Suppress("FrequentlyChangingValue")
507
+ @Composable
508
+ internal fun SearchAnimated(
509
+ snapState: ScrollableState
510
+ ) {
511
+ val scrollState = LocalScrollState.current
512
+ val options = LocalOptions.current
513
+ val navigator = LocalNavigator.current
514
+ val density = LocalDensity.current
515
+
516
+ val scrollDp = with(density) { scrollState.value.toDp() }
517
+
518
+ val inputSearchType = getInputSearchType(options)
519
+ val headerRightWidthPx = LocalHeaderRightWidthPx.current
520
+ val headerRightWidthDp = with(density) { headerRightWidthPx.intValue.toDp() }
521
+
522
+ if (inputSearchType == InputSearchType.None) return
523
+ val inputSearchProps = (options.headerType as? HeaderType.DefaultOrExtended)?.inputSearchProps ?: return
524
+
525
+ val screenLayout = getScreenLayout()
526
+ val useSideBar = screenLayout.sideBar != null
527
+ // collapsed, the search is centered in the bar row
528
+ val minTopPadding = screenLayout.headerStatusBarHeight + (screenLayout.headerBarHeight - HEADER_HEIGHT.dp) / 2
529
+ val maxTopPadding = screenLayout.headerHeight
530
+ // collapsed on the iPhone Duo status bar row, the search stays between its clusters
531
+ val clearance = screenLayout.statusBarClearance
532
+ // stretch screens on wide windows keep the search in the header's centered frame
533
+ val sidePadding = rememberHeaderLayout(options.contentLayout).frameInset
534
+ val minStartPadding = sidePadding
535
+ val maxStartPadding = (clearance?.left ?: 0.dp) +
536
+ if (options.hiddenBack || useSideBar) sidePadding else HEADER_BUTTON_SIZE + sidePadding + HEADER_TITLE_GAP
537
+ val minEndPadding = sidePadding
538
+ val maxEndPadding = (clearance?.right ?: 0.dp) + when {
539
+ options.headerRight is HeaderRight.None -> sidePadding
540
+ useSideBar && options.headerRight is HeaderRight.Toolkit -> sidePadding
541
+ else -> headerRightWidthDp + sidePadding + Spacing.M
542
+ }
543
+
544
+ val targetColor = lerp(
545
+ AppTheme.current.colors.background.surface,
546
+ AppTheme.current.colors.background.default,
547
+ (scrollDp / minTopPadding.coerceAtLeast(1.dp)).coerceIn(0f, 1f)
548
+ )
549
+ val animatedColor by animateColorAsState(targetValue = targetColor, label = "BackgroundColor")
550
+
551
+ val layoutParams = when (inputSearchType) {
552
+ InputSearchType.Header -> {
553
+ InputSearchLayoutParams(
554
+ topPadding = minTopPadding,
555
+ startPadding = maxStartPadding,
556
+ endPadding = maxEndPadding
557
+ )
558
+ }
559
+
560
+ InputSearchType.Animated -> {
561
+ val collapsePx = with(density) { HEADER_HEIGHT.dp.roundToPx() }
562
+ val progress = (scrollState.value / collapsePx.toFloat()).coerceIn(0f, 1f)
563
+
564
+ LaunchedEffect(snapState, collapsePx) {
565
+ snapshotFlow { snapState.isScrollInProgress }
566
+ .filter { !it }
567
+ .collect {
568
+ val offset = snapState.headerOffsetPx() ?: return@collect
569
+ if (offset <= 0 || offset >= collapsePx) return@collect
570
+ val target = if (offset < collapsePx / 2) 0 else collapsePx
571
+ launch { snapState.animateScrollBy((target - offset).toFloat()) }
572
+ }
573
+ }
574
+
575
+ InputSearchLayoutParams(
576
+ topPadding = lerp(maxTopPadding, minTopPadding, progress),
577
+ startPadding = lerp(minStartPadding, maxStartPadding, progress),
578
+ endPadding = lerp(minEndPadding, maxEndPadding, progress)
579
+ )
580
+ }
581
+
582
+ InputSearchType.None -> return
583
+ }
584
+
585
+ Spacer(Modifier.height(layoutParams.topPadding))
586
+ Box(
587
+ modifier = Modifier
588
+ .height(HEADER_HEIGHT.dp)
589
+ .fillMaxWidth()
590
+ .padding(
591
+ start = layoutParams.startPadding,
592
+ end = layoutParams.endPadding
593
+ ),
594
+ contentAlignment = Alignment.Center
595
+ ) {
596
+ InputSearch(
597
+ inputSearchProps = inputSearchProps.copy(
598
+ backgroundColor = animatedColor,
599
+ onPressButtonText = {
600
+ navigator.pop()
601
+ }
602
+ ),
603
+ size = InputSearchSize.Header,
604
+ )
605
+ }
606
+ }
607
+
608
+ private fun ScrollableState.headerOffsetPx(): Int? = when (this) {
609
+ is LazyListState -> if (firstVisibleItemIndex == 0) firstVisibleItemScrollOffset else null
610
+ is ScrollState -> value
611
+ else -> null
612
+ }
613
+
614
+ private fun quantize(value: Int, stepPx: Int): Int {
615
+ if (stepPx <= 1) return value
616
+ return (value / stepPx) * stepPx
617
+ }
618
+
619
+ @Composable
620
+ internal fun LazyListState.proxyScrollState(
621
+ thresholdPx: Int = 200,
622
+ stepPx: Int = 4
623
+ ): Pair<ScrollState, Boolean> = proxyScroll(
624
+ source = this,
625
+ thresholdPx = thresholdPx,
626
+ stepPx = stepPx,
627
+ isScrollInProgress = { isScrollInProgress },
628
+ rawTargetFlow = {
629
+ snapshotFlow {
630
+ if (firstVisibleItemIndex == 0) firstVisibleItemScrollOffset
631
+ else SCROLLED_PAST_FIRST_ITEM_THRESHOLD
632
+ }
633
+ },
634
+ )
635
+
636
+ @Composable
637
+ internal fun ScrollState.proxyLimitedScrollState(
638
+ thresholdPx: Int = 200,
639
+ stepPx: Int = 4
640
+ ): Pair<ScrollState, Boolean> = proxyScroll(
641
+ source = this,
642
+ thresholdPx = thresholdPx,
643
+ stepPx = stepPx,
644
+ isScrollInProgress = { isScrollInProgress },
645
+ rawTargetFlow = { snapshotFlow { value } },
646
+ )
647
+
648
+ @Composable
649
+ private fun proxyScroll(
650
+ source: Any,
651
+ thresholdPx: Int,
652
+ stepPx: Int,
653
+ isScrollInProgress: () -> Boolean,
654
+ rawTargetFlow: () -> Flow<Int>,
655
+ ): Pair<ScrollState, Boolean> {
656
+ val proxy = rememberScrollState()
657
+ val locked = remember { mutableStateOf(false) }
658
+
659
+ LaunchedEffect(source, proxy, thresholdPx, stepPx) {
660
+ rawTargetFlow().collect { rawTarget ->
661
+ val shouldLock = rawTarget > thresholdPx
662
+ if (locked.value != shouldLock) locked.value = shouldLock
663
+
664
+ val desired = if (shouldLock) thresholdPx else quantize(rawTarget, stepPx)
665
+
666
+ if (proxy.value != desired) {
667
+ proxy.scrollTo(desired.coerceAtLeast(0))
668
+ }
669
+ }
670
+ }
671
+
672
+ val inProgress = remember { mutableStateOf(false) }
673
+ LaunchedEffect(source, thresholdPx) {
674
+ snapshotFlow { isScrollInProgress() }
675
+ .collect { progressing ->
676
+ inProgress.value = if (locked.value) false else progressing
677
+ }
678
+ }
679
+
680
+ return proxy to inProgress.value
681
+ }
682
+
683
+ private const val SCROLLED_PAST_FIRST_ITEM_THRESHOLD = 10_000
684
+
685
+ internal val LocalScrollState = staticCompositionLocalOf<ScrollState> { error("No Scroll State provided") }
686
+ internal val LocalOptions = staticCompositionLocalOf<NavigationOptions> { error("No NavigationOptions provided") }
687
+
688
+ val StackScreenScrollableState = staticCompositionLocalOf<ScrollableState?> { null }
689
+
690
+ // iPhone Duo side bar: the header leaves with the content and slides back in on a reverse scroll
691
+ // (RN DuoQuickReturnHeader). The side bar is drawn apart from the header, so it stays put.
692
+ @Composable
693
+ private fun rememberQuickReturnHide(
694
+ enabled: Boolean,
695
+ scrollState: ScrollState,
696
+ heightPx: Float,
697
+ ): Animatable<Float, AnimationVector1D> {
698
+ val hide = remember { Animatable(0f) }
699
+ LaunchedEffect(enabled, scrollState, heightPx) {
700
+ if (!enabled) {
701
+ hide.snapTo(0f)
702
+ return@LaunchedEffect
703
+ }
704
+ var last = scrollState.value
705
+ snapshotFlow { scrollState.value }.collect { y ->
706
+ val delta = y - last
707
+ last = y
708
+ hide.snapTo(if (y <= 0) 0f else (hide.value + delta).coerceIn(0f, heightPx))
709
+ }
710
+ }
711
+ // a half-shown header settles fully in or out once the scroll stops
712
+ LaunchedEffect(enabled, scrollState, heightPx) {
713
+ if (!enabled) return@LaunchedEffect
714
+ snapshotFlow { scrollState.isScrollInProgress }
715
+ .filter { !it }
716
+ .collect {
717
+ val value = hide.value
718
+ // within the first header height the header still sits on the content
719
+ if (scrollState.value < heightPx || value <= 0f || value >= heightPx) return@collect
720
+ launch { hide.animateTo(if (value > heightPx / 2) heightPx else 0f, tween(200)) }
721
+ }
722
+ }
723
+ return hide
724
+ }
725
+
726
+ internal fun NavigationOptions.usesDuoQuickReturnHeader(layout: ScreenLayout): Boolean =
727
+ usesDuoGlassHeader(layout) || (layout.sideBar != null && headerType is HeaderType.Animated &&
728
+ scrollData.scrollable && scrollData.scrollState is ScrollState)
729
+
730
+ // iPhone Duo side bar: content scrolls under a glass header instead of starting below it (RN Screen).
731
+ internal fun NavigationOptions.usesDuoGlassHeader(layout: ScreenLayout): Boolean =
732
+ layout.sideBar != null && headerType is HeaderType.DefaultOrExtended &&
733
+ getInputSearchType(this) == InputSearchType.None &&
734
+ scrollData.scrollable && scrollData.scrollState is ScrollState
735
+
736
+ internal fun getInputSearchType(options: NavigationOptions): InputSearchType {
737
+ return when (val headerType = options.headerType) {
738
+ is HeaderType.DefaultOrExtended -> when {
739
+ headerType.inputSearchProps == null -> InputSearchType.None
740
+ headerType.useAnimated -> InputSearchType.Animated
741
+ else -> InputSearchType.Header
742
+ }
743
+
744
+ else -> InputSearchType.None
745
+ }
746
+ }
747
+