@momo-kits/native-kits 0.89.33-beta.34 → 0.89.33-beta.35
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.
|
@@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.Box
|
|
|
10
10
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
11
11
|
import androidx.compose.foundation.layout.Row
|
|
12
12
|
import androidx.compose.foundation.layout.Spacer
|
|
13
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
13
14
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
14
15
|
import androidx.compose.foundation.layout.height
|
|
15
16
|
import androidx.compose.foundation.layout.padding
|
|
@@ -74,6 +75,14 @@ fun HeaderBackground(
|
|
|
74
75
|
targetValue = (1 - (scrollState / 200f)).coerceIn(0f, 1f),
|
|
75
76
|
)
|
|
76
77
|
|
|
78
|
+
|
|
79
|
+
val backgroundColor = if (scrollState == 0) {
|
|
80
|
+
Color.Transparent
|
|
81
|
+
} else {
|
|
82
|
+
AppTheme.current.colors.background.surface
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
77
86
|
when (headerType) {
|
|
78
87
|
HeaderType.DEFAULT -> {
|
|
79
88
|
val height = statusBarHeight + 52.dp
|
|
@@ -83,6 +92,7 @@ fun HeaderBackground(
|
|
|
83
92
|
strokeWidth = 1.dp,
|
|
84
93
|
color = AppTheme.current.colors.border.default
|
|
85
94
|
)
|
|
95
|
+
.background(backgroundColor)
|
|
86
96
|
) {
|
|
87
97
|
Box(
|
|
88
98
|
modifier = Modifier
|
|
@@ -114,28 +124,34 @@ fun HeaderBackground(
|
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
HeaderType.EXTENDED -> {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
) {
|
|
131
|
-
if (AppTheme.current.assets.headerBackground != null) {
|
|
132
|
-
Image(
|
|
133
|
-
source = headerBanner ?: AppTheme.current.assets.headerBackground!!,
|
|
134
|
-
modifier = Modifier.fillMaxWidth().height(154.dp),
|
|
135
|
-
options = Options(
|
|
136
|
-
contentScale = ContentScale.FillWidth
|
|
127
|
+
|
|
128
|
+
Box(
|
|
129
|
+
modifier = Modifier.fillMaxWidth().height(154.dp)
|
|
130
|
+
.alpha(opacityAni)
|
|
131
|
+
.background(
|
|
132
|
+
Brush.linearGradient(
|
|
133
|
+
colors = listOf(
|
|
134
|
+
Color(0xFFFDCADE),
|
|
135
|
+
Color(0x00FDCADE)
|
|
136
|
+
),
|
|
137
|
+
start = Offset(0f, 0f),
|
|
138
|
+
end = Offset(0f, with(LocalDensity.current) { 154.dp.toPx() })
|
|
139
|
+
)
|
|
137
140
|
)
|
|
138
|
-
|
|
141
|
+
) {
|
|
142
|
+
if (AppTheme.current.assets.headerBackground != null) {
|
|
143
|
+
Box(
|
|
144
|
+
modifier = Modifier.fillMaxWidth()
|
|
145
|
+
.background(backgroundColor)
|
|
146
|
+
) {
|
|
147
|
+
Image(
|
|
148
|
+
source = headerBanner ?: AppTheme.current.assets.headerBackground!!,
|
|
149
|
+
modifier = Modifier.fillMaxWidth().height(154.dp),
|
|
150
|
+
options = Options(
|
|
151
|
+
contentScale = ContentScale.FillWidth
|
|
152
|
+
)
|
|
153
|
+
)
|
|
154
|
+
}
|
|
139
155
|
}
|
|
140
156
|
}
|
|
141
157
|
}
|