@momo-kits/native-kits 0.167.1-duo.6-debug → 0.167.1-duo.7-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.167.1-duo.6-debug"
43
+ version = "0.167.1-duo.7-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -302,11 +302,12 @@ internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTa
302
302
  Spacer(Modifier.height((HEADER_HEIGHT.dp - scrollDp).coerceIn(0.dp, HEADER_HEIGHT.dp)))
303
303
  }
304
304
  // a bottom tab root stays full width: the tab bar and each tab's own StackScreen handle the insets
305
+ val insetContent = !isBottomTabRoot
305
306
  Column(
306
307
  Modifier
307
308
  .fillMaxWidth()
308
309
  .weight(1f)
309
- .conditional(!isBottomTabRoot) {
310
+ .conditional(insetContent && options.headerType !is HeaderType.Animated) {
310
311
  horizontalSafeAreaPadding()
311
312
  }
312
313
  .conditional(options.scrollData.scrollable && options.scrollData.scrollState is ScrollState) {
@@ -324,19 +325,22 @@ internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTa
324
325
  }
325
326
  )
326
327
  ) {
327
- CompositionLocalProvider(
328
- LocalScreenLayout provides if (isBottomTabRoot) screenLayout else screenLayout.consumeHorizontalInsets()
329
- ) {
330
- ScreenContent(content = content)
331
- }
328
+ ScreenContent(content = content, insetContent = insetContent)
332
329
  }
333
330
 
334
331
  }
335
332
 
336
333
  @Composable
337
- internal fun ScreenContent(content: @Composable () -> Unit) {
334
+ internal fun ScreenContent(content: @Composable () -> Unit, insetContent: Boolean) {
338
335
  val scrollState = LocalScrollState.current
339
336
  val options = LocalOptions.current
337
+ val screenLayout = getScreenLayout()
338
+ val insetBody: @Composable () -> Unit = {
339
+ CompositionLocalProvider(
340
+ LocalScreenLayout provides if (insetContent) screenLayout.consumeHorizontalInsets() else screenLayout,
341
+ content = content,
342
+ )
343
+ }
340
344
 
341
345
  if (options.headerType is HeaderType.Animated) {
342
346
  val animatedHeader = options.headerType
@@ -347,12 +351,16 @@ internal fun ScreenContent(content: @Composable () -> Unit) {
347
351
  Box(bannerModifier) {
348
352
  animatedHeader.composable.invoke(scrollState.value)
349
353
  }
350
- Box(Modifier.padding(top = getScreenLayout().headerHeight + animatedHeader.layoutOffSet)) {
351
- content()
354
+ Box(
355
+ Modifier
356
+ .padding(top = screenLayout.headerHeight + animatedHeader.layoutOffSet)
357
+ .conditional(insetContent) { horizontalSafeAreaPadding() }
358
+ ) {
359
+ insetBody()
352
360
  }
353
361
  }
354
362
  } else {
355
- content()
363
+ insetBody()
356
364
  }
357
365
  }
358
366
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.167.1-duo.6-debug",
3
+ "version": "0.167.1-duo.7-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},