@momo-kits/native-kits 0.160.15-debug → 0.160.16-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.
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -38,6 +38,7 @@ import androidx.compose.runtime.produceState
|
|
|
38
38
|
import androidx.compose.runtime.remember
|
|
39
39
|
import androidx.compose.runtime.rememberUpdatedState
|
|
40
40
|
import androidx.compose.runtime.snapshotFlow
|
|
41
|
+
import androidx.compose.runtime.staticCompositionLocalOf
|
|
41
42
|
import androidx.compose.ui.Alignment
|
|
42
43
|
import androidx.compose.ui.Modifier
|
|
43
44
|
import androidx.compose.ui.composed
|
|
@@ -48,6 +49,7 @@ import androidx.compose.ui.geometry.Offset
|
|
|
48
49
|
import androidx.compose.ui.geometry.Rect
|
|
49
50
|
import androidx.compose.ui.graphics.Brush
|
|
50
51
|
import androidx.compose.ui.graphics.Color
|
|
52
|
+
import androidx.compose.ui.graphics.SolidColor
|
|
51
53
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
52
54
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
53
55
|
import androidx.compose.ui.layout.Layout
|
|
@@ -60,19 +62,15 @@ import androidx.compose.ui.layout.layoutId
|
|
|
60
62
|
import androidx.compose.ui.platform.LocalDensity
|
|
61
63
|
import androidx.compose.ui.platform.LocalFocusManager
|
|
62
64
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
63
|
-
import androidx.compose.ui.text.style.TextOverflow
|
|
64
65
|
import androidx.compose.ui.text.TextStyle
|
|
66
|
+
import androidx.compose.ui.text.style.TextOverflow
|
|
65
67
|
import androidx.compose.ui.unit.Constraints
|
|
66
68
|
import androidx.compose.ui.unit.Dp
|
|
67
69
|
import androidx.compose.ui.unit.IntOffset
|
|
68
70
|
import androidx.compose.ui.unit.LayoutDirection
|
|
69
71
|
import androidx.compose.ui.unit.dp
|
|
70
|
-
import androidx.compose.ui.unit.sp
|
|
71
|
-
import androidx.compose.runtime.staticCompositionLocalOf
|
|
72
|
-
import androidx.compose.ui.graphics.Color.Companion
|
|
73
|
-
import androidx.compose.ui.graphics.SolidColor
|
|
74
72
|
import androidx.compose.ui.unit.lerp
|
|
75
|
-
import
|
|
73
|
+
import androidx.compose.ui.unit.sp
|
|
76
74
|
import kotlinx.coroutines.flow.collectLatest
|
|
77
75
|
import kotlinx.coroutines.flow.mapNotNull
|
|
78
76
|
import vn.momo.kits.components.Icon
|
|
@@ -81,11 +79,11 @@ import vn.momo.kits.const.AppTheme
|
|
|
81
79
|
import vn.momo.kits.const.Colors
|
|
82
80
|
import vn.momo.kits.const.Spacing
|
|
83
81
|
import vn.momo.kits.const.Typography
|
|
84
|
-
import vn.momo.kits.modifier.conditional
|
|
85
82
|
import vn.momo.kits.modifier.kitsAutomationId
|
|
86
83
|
import vn.momo.kits.modifier.noFeedbackClickable
|
|
87
84
|
import vn.momo.kits.modifier.setAutomationId
|
|
88
85
|
import vn.momo.kits.modifier.shadow
|
|
86
|
+
import vn.momo.kits.navigation.component.HEADER_HEIGHT
|
|
89
87
|
import vn.momo.kits.utils.getAppStatusBarHeight
|
|
90
88
|
import kotlin.math.max
|
|
91
89
|
import kotlin.math.roundToInt
|
|
@@ -441,6 +439,7 @@ private class LiteScreenLayoutPolicy(
|
|
|
441
439
|
val spacing12 = Spacing.M.roundToPx()
|
|
442
440
|
val spaceBetween = headerSpaceBetween?.roundToPx() ?: spacing12
|
|
443
441
|
val statusBarPx = statusBarHeight.roundToPx()
|
|
442
|
+
val headerRowDefault = HEADER_HEIGHT.dp.roundToPx()
|
|
444
443
|
val scrollPercent = scrollPercentage.value
|
|
445
444
|
|
|
446
445
|
val contentMeasurable = measurables.find { it.layoutId == HeaderId.CONTENT_ID }
|
|
@@ -484,26 +483,20 @@ private class LiteScreenLayoutPolicy(
|
|
|
484
483
|
)
|
|
485
484
|
)
|
|
486
485
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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
|
|
486
|
+
/**
|
|
487
|
+
* replicate logic from [vn.momo.kits.navigation.component.HeaderBackground]
|
|
488
|
+
* */
|
|
489
|
+
var defaultHeight = statusBarPx + headerRowDefault
|
|
500
490
|
if (isHeaderExtend) {
|
|
501
|
-
defaultHeight
|
|
491
|
+
defaultHeight = 154.dp.roundToPx()
|
|
502
492
|
}
|
|
503
493
|
val headerHeight = when {
|
|
504
494
|
isHeaderNone -> statusBarPx
|
|
505
495
|
!useAnimationSearch && !isHeaderExtend -> defaultHeight
|
|
506
|
-
else ->
|
|
496
|
+
else -> {
|
|
497
|
+
val collapsableSpace = defaultHeight - statusBarPx - headerRowDefault
|
|
498
|
+
(defaultHeight - scrollPercent * collapsableSpace).toInt()
|
|
499
|
+
}
|
|
507
500
|
}
|
|
508
501
|
|
|
509
502
|
val layoutWidth = constraints.maxWidth
|
|
@@ -566,14 +559,14 @@ private class LiteScreenLayoutPolicy(
|
|
|
566
559
|
if (backIconPlaceable != null) {
|
|
567
560
|
backIconPlaceable.place(
|
|
568
561
|
x = startX,
|
|
569
|
-
y = startY + backIconPlaceable.verticalCenterOffset(
|
|
562
|
+
y = startY + backIconPlaceable.verticalCenterOffset(headerRowDefault),
|
|
570
563
|
)
|
|
571
564
|
curX += backIconPlaceable.safeWidth + spaceBetween
|
|
572
565
|
}
|
|
573
566
|
|
|
574
567
|
headerRightPlaceable?.place(
|
|
575
568
|
x = layoutWidth - spacing12 - headerRightPlaceable.safeWidth,
|
|
576
|
-
y = startY + headerRightPlaceable.verticalCenterOffset(
|
|
569
|
+
y = startY + headerRightPlaceable.verticalCenterOffset(headerRowDefault),
|
|
577
570
|
)
|
|
578
571
|
|
|
579
572
|
val titleOffset = IntOffset(
|
|
@@ -582,19 +575,19 @@ private class LiteScreenLayoutPolicy(
|
|
|
582
575
|
space = layoutWidth,
|
|
583
576
|
layoutDirection = layoutDirection,
|
|
584
577
|
),
|
|
585
|
-
y = startY + titlePlaceable.verticalCenterOffset(
|
|
578
|
+
y = startY + titlePlaceable.verticalCenterOffset(headerRowDefault),
|
|
586
579
|
)
|
|
587
580
|
|
|
588
581
|
titlePlaceable?.place(titleOffset)
|
|
589
582
|
|
|
590
583
|
if (backIconPlaceable != null || headerRightPlaceable != null || titlePlaceable != null) {
|
|
591
|
-
curY +=
|
|
584
|
+
curY += headerRowDefault
|
|
592
585
|
}
|
|
593
586
|
|
|
594
587
|
val inputSearchOffset = if (isHeaderExtend) {
|
|
595
|
-
val baseY = curY + inputSearchPlaceable.verticalCenterOffset(
|
|
588
|
+
val baseY = curY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault)
|
|
596
589
|
val y = (baseY * (1 - scrollPercent)).toInt().coerceAtLeast(
|
|
597
|
-
startY + inputSearchPlaceable.verticalCenterOffset(
|
|
590
|
+
startY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault)
|
|
598
591
|
)
|
|
599
592
|
IntOffset(
|
|
600
593
|
x = startX + ((backIconPlaceable.safeWidth + spaceBetween) * (scrollPercent * 2f).coerceIn(
|
|
@@ -605,7 +598,7 @@ private class LiteScreenLayoutPolicy(
|
|
|
605
598
|
} else {
|
|
606
599
|
IntOffset(
|
|
607
600
|
x = curX,
|
|
608
|
-
y = startY + inputSearchPlaceable.verticalCenterOffset(
|
|
601
|
+
y = startY + inputSearchPlaceable.verticalCenterOffset(headerRowDefault),
|
|
609
602
|
)
|
|
610
603
|
}
|
|
611
604
|
val finalPosition = lerp(
|
|
@@ -823,7 +816,8 @@ private fun LiteInputSearch(
|
|
|
823
816
|
if (!placeHolder.isNullOrEmpty()) {
|
|
824
817
|
inputSearchProps.customPlaceHolder?.invoke() ?: Text(
|
|
825
818
|
text = placeHolder ?: "",
|
|
826
|
-
style = inputSearchProps.customTextStyle
|
|
819
|
+
style = inputSearchProps.customTextStyle
|
|
820
|
+
?: Typography.bodyDefaultRegular,
|
|
827
821
|
maxLines = 1,
|
|
828
822
|
color = theme.colors.text.hint,
|
|
829
823
|
overflow = TextOverflow.Ellipsis
|
package/gradle.properties
CHANGED