@momo-kits/native-kits 0.161.2-beta.2-debug → 0.161.2-search-header.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 (15) hide show
  1. package/compose/build.gradle.kts +1 -1
  2. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +21 -26
  3. package/example/ios/Example.xcodeproj/xcuserdata/vunh.xcuserdatad/xcschemes/ios.xcscheme +36 -0
  4. package/example/ios/Example.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/xcschememanagement.plist +1 -1
  5. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/xcschememanagement.plist +5 -5
  6. package/gradle.properties +1 -1
  7. package/local.properties +2 -2
  8. package/package.json +1 -1
  9. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  10. /package/example/ios/Example.xcworkspace/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/xcschememanagement.plist +0 -0
  11. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/MoMoUIKits.xcscheme +0 -0
  12. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/Pods-Example.xcscheme +0 -0
  13. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/SDWebImage.xcscheme +0 -0
  14. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/SDWebImageSwiftUI.xcscheme +0 -0
  15. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → vunh.xcuserdatad}/xcschemes/SkeletonUI.xcscheme +0 -0
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.161.2-beta.2-debug"
43
+ version = "0.161.2-search-header.1-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -69,10 +69,9 @@ import androidx.compose.ui.unit.LayoutDirection
69
69
  import androidx.compose.ui.unit.dp
70
70
  import androidx.compose.ui.unit.sp
71
71
  import androidx.compose.runtime.staticCompositionLocalOf
72
- import androidx.compose.ui.graphics.Color.Companion
72
+ import androidx.compose.ui.draw.drawWithCache
73
73
  import androidx.compose.ui.graphics.SolidColor
74
74
  import androidx.compose.ui.unit.lerp
75
- import kotlinx.coroutines.flow.StateFlow
76
75
  import kotlinx.coroutines.flow.collectLatest
77
76
  import kotlinx.coroutines.flow.mapNotNull
78
77
  import vn.momo.kits.components.Icon
@@ -81,11 +80,11 @@ import vn.momo.kits.const.AppTheme
81
80
  import vn.momo.kits.const.Colors
82
81
  import vn.momo.kits.const.Spacing
83
82
  import vn.momo.kits.const.Typography
84
- import vn.momo.kits.modifier.conditional
85
83
  import vn.momo.kits.modifier.kitsAutomationId
86
84
  import vn.momo.kits.modifier.noFeedbackClickable
87
85
  import vn.momo.kits.modifier.setAutomationId
88
86
  import vn.momo.kits.modifier.shadow
87
+ import vn.momo.kits.navigation.component.HEADER_HEIGHT
89
88
  import vn.momo.kits.utils.getAppStatusBarHeight
90
89
  import kotlin.math.max
91
90
  import kotlin.math.roundToInt
@@ -441,6 +440,7 @@ private class LiteScreenLayoutPolicy(
441
440
  val spacing12 = Spacing.M.roundToPx()
442
441
  val spaceBetween = headerSpaceBetween?.roundToPx() ?: spacing12
443
442
  val statusBarPx = statusBarHeight.roundToPx()
443
+ val headerRowDefault = HEADER_HEIGHT.dp.roundToPx()
444
444
  val scrollPercent = scrollPercentage.value
445
445
 
446
446
  val contentMeasurable = measurables.find { it.layoutId == HeaderId.CONTENT_ID }
@@ -484,26 +484,20 @@ private class LiteScreenLayoutPolicy(
484
484
  )
485
485
  )
486
486
 
487
- val firstRowMaxHeight = buildList {
488
- add(backIconPlaceable.safeHeight)
489
- add(headerRightPlaceable.safeHeight)
490
- if (!isHeaderExtend) {
491
- add(inputSearchPlaceable.safeHeight)
492
- }
493
- add(HEADER_HEIGHT.dp.roundToPx())
494
- if (isHeaderExtend) {
495
- add(titlePlaceable.safeHeight)
496
- }
497
- }.max()
498
-
499
- var defaultHeight = statusBarPx + spacing12 + firstRowMaxHeight + spacing12
487
+ /**
488
+ * replicate logic from [vn.momo.kits.navigation.component.HeaderBackground]
489
+ * */
490
+ var defaultHeight = statusBarPx + headerRowDefault
500
491
  if (isHeaderExtend) {
501
- defaultHeight += inputSearchPlaceable.safeHeight + spacing12
492
+ defaultHeight = 154.dp.roundToPx()
502
493
  }
503
494
  val headerHeight = when {
504
495
  isHeaderNone -> statusBarPx
505
496
  !useAnimationSearch && !isHeaderExtend -> defaultHeight
506
- else -> (defaultHeight - scrollPercent * (defaultHeight - statusBarPx - HEADER_HEIGHT.dp.roundToPx())).toInt()
497
+ else -> {
498
+ val collapsableSpace = defaultHeight - statusBarPx - headerRowDefault
499
+ (defaultHeight - scrollPercent * collapsableSpace).toInt()
500
+ }
507
501
  }
508
502
 
509
503
  val layoutWidth = constraints.maxWidth
@@ -566,14 +560,14 @@ private class LiteScreenLayoutPolicy(
566
560
  if (backIconPlaceable != null) {
567
561
  backIconPlaceable.place(
568
562
  x = startX,
569
- y = startY + backIconPlaceable.verticalCenterOffset(firstRowMaxHeight),
563
+ y = startY + backIconPlaceable.verticalCenterOffset(headerRowDefault),
570
564
  )
571
565
  curX += backIconPlaceable.safeWidth + spaceBetween
572
566
  }
573
567
 
574
568
  headerRightPlaceable?.place(
575
569
  x = layoutWidth - spacing12 - headerRightPlaceable.safeWidth,
576
- y = startY + headerRightPlaceable.verticalCenterOffset(firstRowMaxHeight),
570
+ y = startY + headerRightPlaceable.verticalCenterOffset(headerRowDefault),
577
571
  )
578
572
 
579
573
  val titleOffset = IntOffset(
@@ -582,19 +576,19 @@ private class LiteScreenLayoutPolicy(
582
576
  space = layoutWidth,
583
577
  layoutDirection = layoutDirection,
584
578
  ),
585
- y = startY + titlePlaceable.verticalCenterOffset(firstRowMaxHeight),
579
+ y = startY + titlePlaceable.verticalCenterOffset(headerRowDefault),
586
580
  )
587
581
 
588
582
  titlePlaceable?.place(titleOffset)
589
583
 
590
584
  if (backIconPlaceable != null || headerRightPlaceable != null || titlePlaceable != null) {
591
- curY += firstRowMaxHeight
585
+ curY += headerRowDefault
592
586
  }
593
587
 
594
588
  val inputSearchOffset = if (isHeaderExtend) {
595
- val baseY = curY + inputSearchPlaceable.verticalCenterOffset(firstRowMaxHeight)
589
+ val baseY = curY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault)
596
590
  val y = (baseY * (1 - scrollPercent)).toInt().coerceAtLeast(
597
- startY + inputSearchPlaceable.verticalCenterOffset(firstRowMaxHeight)
591
+ startY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault)
598
592
  )
599
593
  IntOffset(
600
594
  x = startX + ((backIconPlaceable.safeWidth + spaceBetween) * (scrollPercent * 2f).coerceIn(
@@ -605,7 +599,7 @@ private class LiteScreenLayoutPolicy(
605
599
  } else {
606
600
  IntOffset(
607
601
  x = curX,
608
- y = startY + inputSearchPlaceable.verticalCenterOffset(firstRowMaxHeight),
602
+ y = startY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault),
609
603
  )
610
604
  }
611
605
  val finalPosition = lerp(
@@ -823,7 +817,8 @@ private fun LiteInputSearch(
823
817
  if (!placeHolder.isNullOrEmpty()) {
824
818
  inputSearchProps.customPlaceHolder?.invoke() ?: Text(
825
819
  text = placeHolder ?: "",
826
- style = inputSearchProps.customTextStyle ?: Typography.bodyDefaultRegular,
820
+ style = inputSearchProps.customTextStyle
821
+ ?: Typography.bodyDefaultRegular,
827
822
  maxLines = 1,
828
823
  color = theme.colors.text.hint,
829
824
  overflow = TextOverflow.Ellipsis
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ version = "1.3">
4
+ <BuildAction>
5
+ <BuildActionEntries>
6
+ <BuildActionEntry
7
+ buildForRunning = "YES">
8
+ <BuildableReference
9
+ BuildableIdentifier = "primary"
10
+ BlueprintIdentifier = "A6A920D22B2ADD1E00C1A11F"
11
+ BuildableName = "Example"
12
+ BlueprintName = "Example"
13
+ ReferencedContainer = "container:Example.xcodeproj">
14
+ </BuildableReference>
15
+ </BuildActionEntry>
16
+ </BuildActionEntries>
17
+ </BuildAction>
18
+ <LaunchAction
19
+ useCustomWorkingDirectory = "NO"
20
+ buildConfiguration = "Debug"
21
+ allowLocationSimulation = "YES">
22
+ <BuildableProductRunnable>
23
+ <BuildableReference
24
+ BuildableIdentifier = "primary"
25
+ BlueprintIdentifier = "A6A920D22B2ADD1E00C1A11F"
26
+ BuildableName = "Example"
27
+ BlueprintName = "Example"
28
+ ReferencedContainer = "container:Example.xcodeproj">
29
+ </BuildableReference>
30
+ </BuildableProductRunnable>
31
+ <LocationScenarioReference
32
+ identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
33
+ referenceType = "1">
34
+ </LocationScenarioReference>
35
+ </LaunchAction>
36
+ </Scheme>
@@ -4,7 +4,7 @@
4
4
  <dict>
5
5
  <key>SchemeUserState</key>
6
6
  <dict>
7
- <key>Example.xcscheme_^#shared#^_</key>
7
+ <key>ios.xcscheme</key>
8
8
  <dict>
9
9
  <key>orderHint</key>
10
10
  <integer>0</integer>
@@ -9,35 +9,35 @@
9
9
  <key>isShown</key>
10
10
  <false />
11
11
  <key>orderHint</key>
12
- <integer>0</integer>
12
+ <integer>1</integer>
13
13
  </dict>
14
14
  <key>Pods-Example.xcscheme</key>
15
15
  <dict>
16
16
  <key>isShown</key>
17
17
  <false />
18
18
  <key>orderHint</key>
19
- <integer>1</integer>
19
+ <integer>2</integer>
20
20
  </dict>
21
21
  <key>SDWebImage.xcscheme</key>
22
22
  <dict>
23
23
  <key>isShown</key>
24
24
  <false />
25
25
  <key>orderHint</key>
26
- <integer>2</integer>
26
+ <integer>3</integer>
27
27
  </dict>
28
28
  <key>SDWebImageSwiftUI.xcscheme</key>
29
29
  <dict>
30
30
  <key>isShown</key>
31
31
  <false />
32
32
  <key>orderHint</key>
33
- <integer>3</integer>
33
+ <integer>4</integer>
34
34
  </dict>
35
35
  <key>SkeletonUI.xcscheme</key>
36
36
  <dict>
37
37
  <key>isShown</key>
38
38
  <false />
39
39
  <key>orderHint</key>
40
- <integer>4</integer>
40
+ <integer>5</integer>
41
41
  </dict>
42
42
  </dict>
43
43
  <key>SuppressBuildableAutocreation</key>
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.161.2-beta.2
21
+ version=0.161.2-search-header.1
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/local.properties CHANGED
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Wed Aug 21 14:20:12 ICT 2024
8
- sdk.dir=/Users/huynhdung/Library/Android/sdk
7
+ #Fri Mar 07 10:22:24 ICT 2025
8
+ sdk.dir=/Users/vunh/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.161.2-beta.2-debug",
3
+ "version": "0.161.2-search-header.1-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},