@momo-kits/native-kits 0.113.3-beta.2 → 0.113.3-beta.4
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.
|
@@ -8,8 +8,6 @@ import androidx.compose.runtime.Composable
|
|
|
8
8
|
import androidx.compose.runtime.getValue
|
|
9
9
|
import androidx.compose.ui.Modifier
|
|
10
10
|
import androidx.compose.ui.graphics.Color
|
|
11
|
-
import androidx.compose.ui.unit.Dp
|
|
12
|
-
import androidx.compose.ui.unit.dp
|
|
13
11
|
import vn.momo.kits.const.AppStatusBar
|
|
14
12
|
import vn.momo.kits.const.AppTheme
|
|
15
13
|
import vn.momo.kits.platform.getStatusBarHeight
|
|
@@ -50,6 +50,7 @@ enum class HeaderType {
|
|
|
50
50
|
@Composable
|
|
51
51
|
fun Screen(
|
|
52
52
|
backgroundColor: Color? = null,
|
|
53
|
+
isBack: Boolean = true,
|
|
53
54
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
54
55
|
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
|
|
55
56
|
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
|
|
@@ -63,6 +64,8 @@ fun Screen(
|
|
|
63
64
|
footer: @Composable (() -> Unit)? = null,
|
|
64
65
|
headerRight: @Composable (() -> Unit)? = { HeaderRight() },
|
|
65
66
|
fabProps: FabProps? = null,
|
|
67
|
+
animatedHeader: AnimatedHeader? = null,
|
|
68
|
+
layoutOffset: Dp = 56.dp,
|
|
66
69
|
inputSearchProps: InputSearchProps? = null,
|
|
67
70
|
useAnimationSearch: Boolean = false,
|
|
68
71
|
headerRightWidth: Dp = 0.dp,
|
|
@@ -85,15 +88,33 @@ fun Screen(
|
|
|
85
88
|
targetValue = ((scrollState.value / 52f)).coerceIn(0f, 1f),
|
|
86
89
|
)
|
|
87
90
|
|
|
91
|
+
val headerAnimated =
|
|
92
|
+
@Composable {
|
|
93
|
+
animatedHeader?.composable?.invoke(scrollState.value)
|
|
94
|
+
}
|
|
95
|
+
|
|
88
96
|
Box(
|
|
89
97
|
Modifier.fillMaxSize()
|
|
90
98
|
.background(backgroundColor ?: AppTheme.current.colors.background.default)
|
|
91
99
|
) {
|
|
92
100
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
if (animatedHeader === null) {
|
|
102
|
+
HeaderBackground(
|
|
103
|
+
headerType = headerType,
|
|
104
|
+
scrollState = scrollState.value
|
|
105
|
+
)
|
|
106
|
+
} else {
|
|
107
|
+
Box(
|
|
108
|
+
Modifier.zIndex(2f)
|
|
109
|
+
.background(Color.White.copy(alpha = opacity))
|
|
110
|
+
.graphicsLayer { alpha = opacity }
|
|
111
|
+
) {
|
|
112
|
+
HeaderBackground(
|
|
113
|
+
headerType = headerType,
|
|
114
|
+
scrollState = scrollState.value
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
97
118
|
Header(
|
|
98
119
|
headerType = headerType,
|
|
99
120
|
title = title,
|
|
@@ -129,7 +150,12 @@ fun Screen(
|
|
|
129
150
|
horizontalAlignment = horizontalAlignment
|
|
130
151
|
) {
|
|
131
152
|
Box {
|
|
153
|
+
headerAnimated()
|
|
132
154
|
Column {
|
|
155
|
+
if (animatedHeader !== null) {
|
|
156
|
+
Spacer(modifier = Modifier.padding(top = statusBarHeight + 52.dp + layoutOffset))
|
|
157
|
+
}
|
|
158
|
+
|
|
133
159
|
if (useAnimationSearch && inputSearchProps != null && headerType == HeaderType.EXTENDED) {
|
|
134
160
|
Spacer(modifier = Modifier.padding(top = statusBarHeight))
|
|
135
161
|
}
|