@momo-kits/native-kits 0.160.1-searchBackground.1-debug → 0.160.1-searchBackground.2-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-searchBackground.1-debug"
43
+ version = "0.160.1-searchBackground.2-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -78,6 +78,7 @@ import vn.momo.kits.const.Colors
78
78
  import vn.momo.kits.const.Radius
79
79
  import vn.momo.kits.const.Spacing
80
80
  import vn.momo.kits.const.Typography
81
+ import vn.momo.kits.modifier.conditional
81
82
  import vn.momo.kits.modifier.kitsAutomationId
82
83
  import vn.momo.kits.modifier.noFeedbackClickable
83
84
  import vn.momo.kits.modifier.setAutomationId
@@ -102,6 +103,7 @@ fun LiteScreen(
102
103
  titlePosition: TitlePosition = TitlePosition.LEFT,
103
104
  headerRightData: HeaderRightData? = null,
104
105
  headerTintColor: Color? = null,
106
+ headerBackgroundColor: Color? = null,
105
107
  /* End of header props */
106
108
 
107
109
  screenContent: @Composable () -> Unit,
@@ -137,6 +139,7 @@ fun LiteScreen(
137
139
  useAnimationSearch = useAnimationSearch,
138
140
  headerRightData = headerRightData,
139
141
  tintColor = headerTintColor,
142
+ headerBackgroundColor = headerBackgroundColor,
140
143
  )
141
144
 
142
145
  Box(
@@ -168,6 +171,7 @@ private fun LiteScreenHeader(
168
171
  titlePosition: TitlePosition = TitlePosition.LEFT,
169
172
  useAnimationSearch: Boolean = true,
170
173
  onGoBack: (() -> Unit)? = null,
174
+ headerBackgroundColor: Color? = null,
171
175
  inputSearchProps: LiteInputSearchProps? = null,
172
176
  headerRight: @Composable (() -> Unit)? = null,
173
177
  ) {
@@ -262,36 +266,42 @@ private fun LiteScreenHeader(
262
266
  HeaderId.EXTENDED_HEADER_HEIGHT.toPx(),
263
267
  size.height,
264
268
  )
265
- drawRect(color = Colors.black_01)
266
- drawRect(
267
- brush = Brush.linearGradient(
268
- colors = listGradientColors,
269
- start = Offset.Zero,
270
- end = Offset(
271
- x = 0f,
272
- y = headerHeight * (1 - scrollPercentage.value),
273
- ),
269
+ headerBackgroundColor?.let {
270
+ drawRect(color = it)
271
+ } ?: run {
272
+ drawRect(color = Colors.black_01)
273
+ drawRect(
274
+ brush = Brush.linearGradient(
275
+ colors = listGradientColors,
276
+ start = Offset.Zero,
277
+ end = Offset(
278
+ x = 0f,
279
+ y = headerHeight * (1 - scrollPercentage.value),
280
+ ),
281
+ )
274
282
  )
275
- )
283
+ }
276
284
  },
277
285
  content = {
278
286
  if (onGoBack != null) {
279
- inputSearchProps?.customBackIcon?.invoke() ?: Box(
287
+ Box(
280
288
  modifier = Modifier
281
289
  .size(28.dp)
282
290
  .layoutId(HeaderId.BACK_ID)
283
291
  .clip(CircleShape)
284
- .border(
285
- width = 0.2.dp,
286
- color = headerColor.borderColor,
287
- shape = CircleShape,
288
- )
289
- .background(color = headerColor.backgroundButton)
292
+ .conditional(inputSearchProps?.customBackIcon == null) {
293
+ this.border(
294
+ width = 0.2.dp,
295
+ color = headerColor.borderColor,
296
+ shape = CircleShape,
297
+ )
298
+ .background(color = headerColor.backgroundButton)
299
+ }
290
300
  .noFeedbackClickable(onClick = onGoBack)
291
301
  .setAutomationId("btn_navigation_back")
292
302
  .padding(Spacing.XS),
293
303
  ) {
294
- Icon(
304
+ inputSearchProps?.customBackIcon?.invoke() ?: Icon(
295
305
  source = "arrow-back",
296
306
  color = headerColor.tintIconColor,
297
307
  size = 20.dp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.160.1-searchBackground.1-debug",
3
+ "version": "0.160.1-searchBackground.2-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},