@momo-kits/native-kits 0.160.2-beta.2-debug → 0.160.2-beta.3-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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.160.2-beta.2-debug"
43
+ version = "0.160.2-beta.3-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -135,9 +135,7 @@ fun NavigationContainer(
135
135
  DisposableEffect(Unit) {
136
136
  onDispose {
137
137
  navigator.dispose()
138
- // AI-GENERATED START: unregister initial screen on dispose to avoid leaking a stale registry entry
139
138
  DynamicScreenRegistry.unregisterScreen(screenId)
140
- // AI-GENERATED END: unregister initial screen on dispose to avoid leaking a stale registry entry
141
139
  }
142
140
  }
143
141
  }
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Column
11
11
  import androidx.compose.foundation.layout.ColumnScope
12
12
  import androidx.compose.foundation.layout.Spacer
13
13
  import androidx.compose.foundation.layout.WindowInsets
14
+ import androidx.compose.foundation.layout.asPaddingValues
14
15
  import androidx.compose.foundation.layout.aspectRatio
15
16
  import androidx.compose.foundation.layout.fillMaxSize
16
17
  import androidx.compose.foundation.layout.fillMaxWidth
@@ -27,10 +28,12 @@ import androidx.compose.material.ExperimentalMaterialApi
27
28
  import androidx.compose.runtime.Composable
28
29
  import androidx.compose.runtime.CompositionLocalProvider
29
30
  import androidx.compose.runtime.LaunchedEffect
31
+ import androidx.compose.runtime.State
30
32
  import androidx.compose.runtime.getValue
31
33
  import androidx.compose.runtime.mutableIntStateOf
32
34
  import androidx.compose.runtime.mutableStateOf
33
35
  import androidx.compose.runtime.remember
36
+ import androidx.compose.runtime.rememberUpdatedState
34
37
  import androidx.compose.runtime.snapshotFlow
35
38
  import androidx.compose.runtime.staticCompositionLocalOf
36
39
  import androidx.compose.ui.Alignment
@@ -179,11 +182,11 @@ internal fun StackScreen(
179
182
  HeaderBackground()
180
183
  }
181
184
 
182
- Box(Modifier.zIndex(5f)) {
185
+ Box(Modifier.zIndex(4f)) {
183
186
  Header(onBackHandler)
184
187
  }
185
188
 
186
- Column(Modifier.zIndex(6f)) {
189
+ Column(Modifier.zIndex(5f)) {
187
190
  SearchAnimated(isScrollInProgress = scrollInProcess)
188
191
  }
189
192
 
@@ -192,7 +195,7 @@ internal fun StackScreen(
192
195
  FooterContent()
193
196
  }
194
197
 
195
- Box(Modifier.zIndex(7f)) {
198
+ Box(Modifier.zIndex(6f)) {
196
199
  FloatingContent()
197
200
  }
198
201
 
@@ -284,22 +287,24 @@ fun ScreenContent(content: @Composable () -> Unit) {
284
287
  fun FooterContent() {
285
288
  val options = LocalOptions.current
286
289
  if (options.footerComponent != null) {
287
- val ime = WindowInsets.ime
288
- val density = LocalDensity.current
289
- val imeBottom = ime.getBottom(density)
290
- val thresholdPx = with(density) { 50.dp.toPx() }
291
- val isKeyboardVisible = imeBottom > thresholdPx
292
- val bottomPadding = if (isKeyboardVisible) 0.dp else AppNavigationBar.current
290
+ val keyboardSize = keyboardSizeState()
291
+ val bottomPadding = (AppNavigationBar.current - keyboardSize.value).coerceAtLeast(0.dp)
293
292
  Footer(footerComponent = options.footerComponent, bottomPadding = bottomPadding)
294
293
  }
295
294
  }
296
295
 
296
+ @Composable
297
+ fun keyboardSizeState(): State<Dp> {
298
+ val bottom = WindowInsets.ime.asPaddingValues()
299
+ return rememberUpdatedState(bottom.calculateBottomPadding())
300
+ }
301
+
297
302
  @Composable
298
303
  fun OverplayView(bottomTabIndex: Int, id: Int) {
299
304
  val overplayType = OverplayComponentRegistry.getOverplayType()
300
305
 
301
306
  if (overplayType != null) {
302
- Box(Modifier.zIndex(if (overplayType == OverplayComponentType.SNACK_BAR) 3f else 8f).fillMaxSize()) {
307
+ Box(Modifier.zIndex(if (overplayType == OverplayComponentType.SNACK_BAR) 3f else 7f).fillMaxSize()) {
303
308
  if (bottomTabIndex != -1) return@Box
304
309
  if (OverplayComponentRegistry.currentRootId() != id) return@Box
305
310
  OverplayComponentRegistry.OverlayComponent()
@@ -458,13 +463,6 @@ fun SearchAnimated(
458
463
  }
459
464
  }
460
465
 
461
- @Composable
462
- internal fun isKeyboardVisible(): Boolean {
463
- val ime = WindowInsets.ime
464
- val density = LocalDensity.current
465
- return ime.getBottom(density) > 0
466
- }
467
-
468
466
  private fun quantize(value: Int, stepPx: Int): Int {
469
467
  if (stepPx <= 1) return value
470
468
  return (value / stepPx) * stepPx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.160.2-beta.2-debug",
3
+ "version": "0.160.2-beta.3-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
@@ -1,9 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "WebSearch",
5
- "Bash(./gradlew assembleDebug 2>&1)",
6
- "Bash(./gradlew :sample:androidApp:installDebug 2>&1)"
7
- ]
8
- }
9
- }
package/local.properties DELETED
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Tue May 19 15:41:04 GMT+07:00 2026
8
- sdk.dir=/Users/phuc/Library/Android/sdk