@momo-kits/native-kits 0.160.1-beta.8-debug → 0.160.1-beta.9-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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.160.1-beta.8-debug"
43
+ version = "0.160.1-beta.9-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -174,6 +174,10 @@ internal fun StackScreen(
174
174
  HeaderBackground()
175
175
  }
176
176
 
177
+ Box(Modifier.zIndex(1.5f)) {
178
+ AnimatedHeaderImage()
179
+ }
180
+
177
181
  Box(Modifier.zIndex(5f)) {
178
182
  Header(onBackHandler)
179
183
  }
@@ -231,7 +235,7 @@ fun ColumnScope.MainContent(content: @Composable ()-> Unit){
231
235
  val scrollState = LocalScrollState.current
232
236
 
233
237
  Spacer(Modifier.height(
234
- if (options.headerType is HeaderType.DefaultOrExtended || (options.headerType is HeaderType.Transparent && !options.headerType.isFullScreenContent))
238
+ if (options.headerType is HeaderType.DefaultOrExtended || (options.headerType is HeaderType.Transparent && !options.headerType.isFullScreenContent) || options.headerType is HeaderType.Animated)
235
239
  AppStatusBar.current + HEADER_HEIGHT.dp else 0.dp)
236
240
  )
237
241
  if (inputSearchType == InputSearchType.Animated){
@@ -246,7 +250,7 @@ fun ColumnScope.MainContent(content: @Composable ()-> Unit){
246
250
  Column (Modifier
247
251
  .fillMaxWidth()
248
252
  .weight(1f)
249
- .conditional(options.scrollData.scrollable && options.scrollData.scrollState is ScrollState) {
253
+ .conditional(options.scrollData.scrollable && options.scrollData.scrollState !is LazyListState) {
250
254
  verticalScroll(scrollState)
251
255
  }
252
256
  ) {
@@ -262,24 +266,37 @@ fun ColumnScope.MainContent(content: @Composable ()-> Unit){
262
266
 
263
267
  @Composable
264
268
  fun ScreenContent(content: @Composable () -> Unit){
265
- val scrollState = LocalScrollState.current
266
269
  val options = LocalOptions.current
267
270
 
268
271
  if (options.headerType is HeaderType.Animated){
269
272
  val animatedHeader = options.headerType
270
- Box {
271
- Box(Modifier.fillMaxWidth().aspectRatio(animatedHeader.aspectRatio.value)){
272
- animatedHeader.composable.invoke(scrollState.value)
273
- }
274
- Box(Modifier.offset(x = 0.dp, y = AppStatusBar.current + HEADER_HEIGHT.dp + animatedHeader.layoutOffSet)){
275
- content()
276
- }
273
+ Column {
274
+ Spacer(Modifier.height(animatedHeader.layoutOffSet))
275
+ content()
277
276
  }
278
277
  } else {
279
278
  content()
280
279
  }
281
280
  }
282
281
 
282
+ @Composable
283
+ fun AnimatedHeaderImage() {
284
+ val options = LocalOptions.current
285
+ val scrollState = LocalScrollState.current
286
+ val animatedHeader = options.headerType as? HeaderType.Animated ?: return
287
+ val density = LocalDensity.current
288
+ val scrollDp = with(density) { scrollState.value.toDp() }
289
+
290
+ Box(
291
+ Modifier
292
+ .fillMaxWidth()
293
+ .offset(y = -scrollDp)
294
+ .aspectRatio(animatedHeader.aspectRatio.value)
295
+ ) {
296
+ animatedHeader.composable.invoke(scrollState.value)
297
+ }
298
+ }
299
+
283
300
  @Composable
284
301
  fun FooterContent(){
285
302
  val options = LocalOptions.current
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.160.1-beta.8-debug",
3
+ "version": "0.160.1-beta.9-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},