@momo-kits/native-kits 0.153.1-beta.1 → 0.153.1-beta.2

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 (90) hide show
  1. package/build/reports/problems/problems-report.html +1 -1
  2. package/compose/build/.transforms/383412ef60e9923a766a9c9a776b5772/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenHelper$hideSnackBar$1.dex +0 -0
  4. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenHelper$showSnackBar$1.dex +0 -0
  5. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenHelper.dex +0 -0
  6. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt$Screen$2.dex +0 -0
  7. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt$Screen$headerAnimated$1.dex +0 -0
  8. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$1$1.dex +0 -0
  9. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$2$1.dex +0 -0
  10. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$3$1.dex +0 -0
  11. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/{ScreenKt$ScreenSnackBarHost$lambda$21$lambda$20$$inlined$onDispose$1.dex → ScreenKt$ScreenSnackBarHost$lambda$26$lambda$25$$inlined$onDispose$1.dex} +0 -0
  12. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/ScreenKt.dex +0 -0
  13. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/application/SnackBarData.dex +0 -0
  14. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBar$Custom.dex +0 -0
  15. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBar.dex +0 -0
  16. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$1$1.dex +0 -0
  17. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$2$1.dex +0 -0
  18. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$closeEvent$1.dex +0 -0
  19. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/{SnackBarKt$SnackBar$lambda$8$lambda$7$$inlined$onDispose$1.dex → SnackBarKt$SnackBar$lambda$12$lambda$11$$inlined$onDispose$1.dex} +0 -0
  20. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$openEvent$1.dex +0 -0
  21. package/compose/build/.transforms/cb651ee4c7ad7bad24b060aca35332d7/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/vn/momo/kits/navigation/component/SnackBarKt.dex +0 -0
  22. package/compose/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  23. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenHelper$hideSnackBar$1.class +0 -0
  24. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenHelper$showSnackBar$1.class +0 -0
  25. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenHelper.class +0 -0
  26. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$Screen$2.class +0 -0
  27. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$Screen$headerAnimated$1.class +0 -0
  28. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$1$1.class +0 -0
  29. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$2$1.class +0 -0
  30. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$3$1.class +0 -0
  31. package/compose/build/{tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$lambda$21$lambda$20$$inlined$onDispose$1.class → intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$lambda$26$lambda$25$$inlined$onDispose$1.class} +0 -0
  32. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt.class +0 -0
  33. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/SnackBarData.class +0 -0
  34. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBar$Custom.class +0 -0
  35. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBar.class +0 -0
  36. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$1$1.class +0 -0
  37. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$2$1.class +0 -0
  38. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$closeEvent$1.class +0 -0
  39. package/compose/build/{tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$lambda$8$lambda$7$$inlined$onDispose$1.class → intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$lambda$12$lambda$11$$inlined$onDispose$1.class} +0 -0
  40. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$openEvent$1.class +0 -0
  41. package/compose/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt.class +0 -0
  42. package/compose/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  43. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  44. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/inputs/source-to-output.tab.values +0 -0
  45. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  46. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/inputs/source-to-output.tab.values.s +1 -1
  47. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  48. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  49. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  50. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  51. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  52. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
  53. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  54. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -1
  55. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  56. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values +0 -0
  57. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  58. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.s +1 -1
  59. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  60. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  61. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  62. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  63. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
  64. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  65. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -1
  66. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  67. package/compose/build/kotlin/compileDebugKotlinAndroid/cacheable/last-build.bin +0 -0
  68. package/compose/build/kotlin/compileDebugKotlinAndroid/local-state/build-history.bin +0 -0
  69. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenHelper$hideSnackBar$1.class +0 -0
  70. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenHelper$showSnackBar$1.class +0 -0
  71. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenHelper.class +0 -0
  72. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$Screen$2.class +0 -0
  73. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$Screen$headerAnimated$1.class +0 -0
  74. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$1$1.class +0 -0
  75. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$2$1.class +0 -0
  76. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$3$1.class +0 -0
  77. package/compose/build/{intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$lambda$21$lambda$20$$inlined$onDispose$1.class → tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt$ScreenSnackBarHost$lambda$26$lambda$25$$inlined$onDispose$1.class} +0 -0
  78. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/ScreenKt.class +0 -0
  79. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/application/SnackBarData.class +0 -0
  80. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBar$Custom.class +0 -0
  81. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBar.class +0 -0
  82. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$1$1.class +0 -0
  83. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$2$1.class +0 -0
  84. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$closeEvent$1.class +0 -0
  85. package/compose/build/{intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$lambda$8$lambda$7$$inlined$onDispose$1.class → tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$lambda$12$lambda$11$$inlined$onDispose$1.class} +0 -0
  86. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt$SnackBar$openEvent$1.class +0 -0
  87. package/compose/build/tmp/kotlin-classes/debug/vn/momo/kits/navigation/component/SnackBarKt.class +0 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +25 -13
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +25 -23
  90. package/package.json +1 -1
@@ -650,7 +650,7 @@ code + .copy-button {
650
650
  <script type="text/javascript">
651
651
  function configurationCacheProblems() { return (
652
652
  // begin-report-data
653
- {"diagnostics":[{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The StartParameter.isConfigurationCacheRequested property has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 10.0."}],"contextualLabel":"The StartParameter.isConfigurationCacheRequested property has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#deprecated_startparameter_is_configuration_cache_requested","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-startparameter-isconfigurationcacherequested-property-has-been-deprecated","displayName":"The StartParameter.isConfigurationCacheRequested property has been deprecated."}],"solutions":[[{"text":"Please use 'configurationCache.requested' property on 'BuildFeatures' service instead."}]]}],"problemsReport":{"totalProblemCount":1,"buildName":"momo-kits","requestedTasks":":sample:androidApp:assembleDebug","documentationLink":"https://docs.gradle.org/8.14.1/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
653
+ {"diagnostics":[{"locations":[{},{"pluginId":"com.android.internal.application"}],"problem":[{"text":"Retrieving attribute with a null key. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 10.0."}],"contextualLabel":"Retrieving attribute with a null key. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#null-attribute-lookup","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"retrieving-attribute-with-a-null-key-this-behavior-has-been-deprecated","displayName":"Retrieving attribute with a null key. This behavior has been deprecated."}],"solutions":[[{"text":"Don't request attributes from attribute containers using null keys."}]]},{"locations":[{},{"pluginId":"com.android.internal.application"}],"problem":[{"text":"Retrieving attribute with a null key. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 10.0."}],"contextualLabel":"Retrieving attribute with a null key. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#null-attribute-lookup","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"retrieving-attribute-with-a-null-key-this-behavior-has-been-deprecated","displayName":"Retrieving attribute with a null key. This behavior has been deprecated."}],"solutions":[[{"text":"Don't request attributes from attribute containers using null keys."}]]},{"locations":[{},{"pluginId":"com.android.internal.application"}],"problem":[{"text":"Retrieving attribute with a null key. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 10.0."}],"contextualLabel":"Retrieving attribute with a null key. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#null-attribute-lookup","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"retrieving-attribute-with-a-null-key-this-behavior-has-been-deprecated","displayName":"Retrieving attribute with a null key. This behavior has been deprecated."}],"solutions":[[{"text":"Don't request attributes from attribute containers using null keys."}]]},{"locations":[{},{"pluginId":"com.android.internal.application"}],"problem":[{"text":"Retrieving attribute with a null key. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 10.0."}],"contextualLabel":"Retrieving attribute with a null key. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#null-attribute-lookup","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"retrieving-attribute-with-a-null-key-this-behavior-has-been-deprecated","displayName":"Retrieving attribute with a null key. This behavior has been deprecated."}],"solutions":[[{"text":"Don't request attributes from attribute containers using null keys."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"Retrieving attribute with a null key. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 10.0."}],"contextualLabel":"Retrieving attribute with a null key. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14.1/userguide/upgrading_version_8.html#null-attribute-lookup","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"retrieving-attribute-with-a-null-key-this-behavior-has-been-deprecated","displayName":"Retrieving attribute with a null key. This behavior has been deprecated."}],"solutions":[[{"text":"Don't request attributes from attribute containers using null keys."}]]}],"problemsReport":{"totalProblemCount":5,"buildName":"momo-kits","requestedTasks":"","documentationLink":"https://docs.gradle.org/8.14.1/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
654
654
  // end-report-data
655
655
  );}
656
656
  </script>
@@ -1 +1 @@
1
- ���������
1
+ ����Ҿ���
@@ -248,7 +248,7 @@ fun Screen(
248
248
  .align(Alignment.BottomCenter)
249
249
  .zIndex(3f)
250
250
  ) {
251
- ScreenSnackBarHost(footerHeightPx.value)
251
+ ScreenSnackBarHost(if (footer == null) 0 else footerHeightPx.value)
252
252
  }
253
253
  }
254
254
  }
@@ -335,21 +335,27 @@ val LocalScreenHelper = staticCompositionLocalOf<ScreenHelper> {
335
335
  fun ScreenSnackBarHost(footerHeightPx: Int) {
336
336
  val helper = LocalScreenHelper.current
337
337
  val snackBarData = helper.snackBarState ?: return
338
+ val density = LocalDensity.current
339
+ val navigationBar = AppNavigationBar.current
338
340
 
341
+ val footerHeight = if (footerHeightPx > 0) {
342
+ footerHeightPx
343
+ } else {
344
+ with(density) {
345
+ min(navigationBar, 21.dp).toPx()
346
+ }
347
+ }.toInt()
339
348
 
340
- val snackBarHeight = when (snackBarData.type) {
341
- is SnackBar.Custom -> snackBarData.type.heightContent
342
- is SnackBar.Toast -> 300f
343
- }
344
-
345
- val startPosition = if (footerHeightPx > 0) 0f else snackBarHeight
346
- val targetPosition = if (footerHeightPx > 0) -footerHeightPx.toFloat() else -with(LocalDensity.current) { AppNavigationBar.current.toPx() }
349
+ var startPosition by remember { mutableStateOf(Float.MAX_VALUE) }
350
+ val targetPosition = 0f
347
351
 
348
- val offsetY = remember { Animatable(startPosition) }
352
+ var offsetY by remember { mutableStateOf(Animatable(startPosition)) }
349
353
 
350
- LaunchedEffect(snackBarData, footerHeightPx) {
351
- offsetY.snapTo(startPosition)
352
- offsetY.animateTo(targetPosition, tween(350))
354
+ LaunchedEffect(startPosition) {
355
+ if (startPosition != Float.MAX_VALUE){
356
+ offsetY.snapTo(startPosition)
357
+ offsetY.animateTo(targetPosition, tween(350))
358
+ }
353
359
  }
354
360
 
355
361
  LaunchedEffect(helper.requestHide) {
@@ -374,7 +380,13 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
374
380
 
375
381
  Box(
376
382
  modifier = Modifier
377
- .offset { IntOffset(0, offsetY.value.toInt()) }
383
+ .offset { IntOffset(0, offsetY.value.toInt() - footerHeight) }
384
+ .onGloballyPositioned {
385
+ if (startPosition != it.size.height.toFloat()) {
386
+ startPosition = it.size.height.toFloat()
387
+ offsetY = Animatable(startPosition)
388
+ }
389
+ }
378
390
  .fillMaxWidth()
379
391
  ) {
380
392
  when (val type = snackBarData.type) {
@@ -5,7 +5,6 @@ import androidx.compose.animation.core.tween
5
5
  import androidx.compose.foundation.layout.Box
6
6
  import androidx.compose.foundation.layout.fillMaxWidth
7
7
  import androidx.compose.foundation.layout.offset
8
- import androidx.compose.foundation.layout.padding
9
8
  import androidx.compose.runtime.Composable
10
9
  import androidx.compose.runtime.DisposableEffect
11
10
  import androidx.compose.runtime.LaunchedEffect
@@ -13,7 +12,9 @@ import androidx.compose.runtime.getValue
13
12
  import androidx.compose.runtime.mutableStateOf
14
13
  import androidx.compose.runtime.remember
15
14
  import androidx.compose.runtime.rememberCoroutineScope
15
+ import androidx.compose.runtime.setValue
16
16
  import androidx.compose.ui.Modifier
17
+ import androidx.compose.ui.layout.onGloballyPositioned
17
18
  import androidx.compose.ui.platform.LocalDensity
18
19
  import androidx.compose.ui.unit.IntOffset
19
20
  import androidx.compose.ui.unit.dp
@@ -21,7 +22,6 @@ import androidx.compose.ui.unit.min
21
22
  import kotlinx.coroutines.delay
22
23
  import kotlinx.coroutines.launch
23
24
  import vn.momo.kits.const.AppNavigationBar
24
- import vn.momo.kits.const.Spacing
25
25
  import vn.momo.kits.navigation.LocalFooterHeightPx
26
26
  import vn.momo.kits.navigation.LocalNavigator
27
27
  import vn.momo.kits.navigation.LocalOptions
@@ -30,7 +30,6 @@ import vn.momo.kits.navigation.OverplayComponentRegistry
30
30
  sealed class SnackBar(open val duration: Long? = null) {
31
31
  data class Custom(
32
32
  val content: @Composable () -> Unit,
33
- val heightContent: Float = 300f,
34
33
  override val duration: Long? = 3000L
35
34
  ) : SnackBar(duration)
36
35
 
@@ -46,27 +45,26 @@ fun SnackBar(
46
45
  ) {
47
46
  val navigator = LocalNavigator.current
48
47
  val options = LocalOptions.current
48
+ val density = LocalDensity.current
49
49
  val footerHeightPxState = LocalFooterHeightPx.current
50
+ val navigationBar = AppNavigationBar.current
50
51
 
51
- val snackBarHeight = when (data) {
52
- is SnackBar.Custom -> -data.heightContent
53
- is SnackBar.Toast -> -300f
54
- }
55
-
56
- val startPosition = if (options.footerComponent != null) 0f else -snackBarHeight
57
- val targetPosition = if (options.footerComponent != null) {
58
- footerHeightPxState.intValue.toFloat()
52
+ val footerHeight = if (options.footerComponent != null) {
53
+ footerHeightPxState.value
59
54
  } else {
60
- with(LocalDensity.current) { min(AppNavigationBar.current, 21.dp).toPx() }
61
- }
55
+ with(density){ min(navigationBar, 21.dp).toPx() }
56
+ }.toInt()
62
57
 
63
- val offsetY by remember { mutableStateOf(Animatable(startPosition)) }
58
+ var startPosition by remember { mutableStateOf(Float.MAX_VALUE) }
59
+ val targetPosition = 0f
60
+
61
+ var offsetY by remember { mutableStateOf(Animatable(startPosition)) }
64
62
  val coroutineScope = rememberCoroutineScope()
65
63
 
66
64
  suspend fun openEvent() {
67
65
  offsetY.snapTo(startPosition)
68
66
  offsetY.animateTo(
69
- targetValue = -targetPosition,
67
+ targetValue = targetPosition,
70
68
  animationSpec = tween(
71
69
  durationMillis = 350,
72
70
  )
@@ -85,8 +83,10 @@ fun SnackBar(
85
83
  }
86
84
  }
87
85
 
88
- LaunchedEffect(targetPosition) {
89
- openEvent()
86
+ LaunchedEffect(startPosition) {
87
+ if (startPosition != Float.MAX_VALUE){
88
+ openEvent()
89
+ }
90
90
  }
91
91
 
92
92
  LaunchedEffect(data.duration) {
@@ -108,8 +108,13 @@ fun SnackBar(
108
108
 
109
109
  Box(
110
110
  modifier = Modifier
111
- .offset { IntOffset(0, offsetY.value.toInt()) }
112
- .padding(bottom = Spacing.S)
111
+ .offset { IntOffset(0, offsetY.value.toInt() - footerHeight) }
112
+ .onGloballyPositioned {
113
+ if (startPosition != it.size.height.toFloat()) {
114
+ startPosition = it.size.height.toFloat()
115
+ offsetY = Animatable(startPosition)
116
+ }
117
+ }
113
118
  .fillMaxWidth()
114
119
  ) {
115
120
  when (data) {
@@ -117,7 +122,4 @@ fun SnackBar(
117
122
  is SnackBar.Toast -> {}
118
123
  }
119
124
  }
120
- }
121
-
122
-
123
-
125
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.153.1-beta.1",
3
+ "version": "0.153.1-beta.2",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@momo-platform/native-max-api": "1.0.18"