@momo-kits/native-kits 0.113.3-beta.3 → 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.
|
@@ -64,6 +64,8 @@ fun Screen(
|
|
|
64
64
|
footer: @Composable (() -> Unit)? = null,
|
|
65
65
|
headerRight: @Composable (() -> Unit)? = { HeaderRight() },
|
|
66
66
|
fabProps: FabProps? = null,
|
|
67
|
+
animatedHeader: AnimatedHeader? = null,
|
|
68
|
+
layoutOffset: Dp = 56.dp,
|
|
67
69
|
inputSearchProps: InputSearchProps? = null,
|
|
68
70
|
useAnimationSearch: Boolean = false,
|
|
69
71
|
headerRightWidth: Dp = 0.dp,
|
|
@@ -86,15 +88,33 @@ fun Screen(
|
|
|
86
88
|
targetValue = ((scrollState.value / 52f)).coerceIn(0f, 1f),
|
|
87
89
|
)
|
|
88
90
|
|
|
91
|
+
val headerAnimated =
|
|
92
|
+
@Composable {
|
|
93
|
+
animatedHeader?.composable?.invoke(scrollState.value)
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
Box(
|
|
90
97
|
Modifier.fillMaxSize()
|
|
91
98
|
.background(backgroundColor ?: AppTheme.current.colors.background.default)
|
|
92
99
|
) {
|
|
93
100
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
+
}
|
|
98
118
|
Header(
|
|
99
119
|
headerType = headerType,
|
|
100
120
|
title = title,
|
|
@@ -130,7 +150,12 @@ fun Screen(
|
|
|
130
150
|
horizontalAlignment = horizontalAlignment
|
|
131
151
|
) {
|
|
132
152
|
Box {
|
|
153
|
+
headerAnimated()
|
|
133
154
|
Column {
|
|
155
|
+
if (animatedHeader !== null) {
|
|
156
|
+
Spacer(modifier = Modifier.padding(top = statusBarHeight + 52.dp + layoutOffset))
|
|
157
|
+
}
|
|
158
|
+
|
|
134
159
|
if (useAnimationSearch && inputSearchProps != null && headerType == HeaderType.EXTENDED) {
|
|
135
160
|
Spacer(modifier = Modifier.padding(top = statusBarHeight))
|
|
136
161
|
}
|