@momo-kits/native-kits 0.157.1-test.1-debug → 0.157.1-test.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.157.1-test.1-debug"
43
+ version = "0.157.1-test.2-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.156.6-beta.16'
3
+ spec.version = '0.157.1-test.2'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -25,7 +25,6 @@ import com.airbnb.lottie.compose.rememberLottieDynamicProperties
25
25
  import com.airbnb.lottie.compose.rememberLottieDynamicProperty
26
26
  import vn.momo.kits.const.AppNavigationBar
27
27
  import vn.momo.kits.const.AppStatusBar
28
- import vn.momo.kits.utils.readJson
29
28
  import androidx.activity.compose.BackHandler as AndroidBackHandler
30
29
 
31
30
  actual fun getPlatformName(): String = "Android"
@@ -72,15 +71,9 @@ actual fun LottieAnimation(
72
71
  bgColor: Color?,
73
72
  modifier: Modifier
74
73
  ) {
75
- val json = readJson(path)
76
-
77
- if (json.isEmpty()) {
78
- Box(modifier)
79
- return
80
- }
81
-
74
+ val assetPath = "composeResources/vn.momo.compose.resources/${path}.json"
82
75
  val composition by rememberLottieComposition(
83
- LottieCompositionSpec.JsonString(json)
76
+ LottieCompositionSpec.Asset(assetPath)
84
77
  )
85
78
 
86
79
  val colorFilter = PorterDuffColorFilter(
@@ -135,8 +135,9 @@ internal fun RenderTitle(size: Size, title: String = "", textColor: Color) {
135
135
  )
136
136
  }
137
137
 
138
+ //TODO add internal
138
139
  @Composable
139
- internal fun RenderIcon(
140
+ fun RenderIcon(
140
141
  size: Size,
141
142
  isIconLeft: Boolean,
142
143
  useTintColor: Boolean = true,
@@ -128,7 +128,7 @@ private class PasswordVisualTransformation(
128
128
  }
129
129
 
130
130
  @Composable
131
- internal fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color {
131
+ fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color {
132
132
  val theme = AppTheme.current
133
133
  return remember(isFocused, error, disabled, theme) {
134
134
  when {
@@ -140,8 +140,9 @@ internal fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean
140
140
  }
141
141
  }
142
142
 
143
+ //TODO add internal
143
144
  @Composable
144
- internal fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit, modifier: Modifier = Modifier) {
145
+ fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit, modifier: Modifier = Modifier) {
145
146
  if (loading) {
146
147
  Box {
147
148
  CircularProgressIndicator(
@@ -166,8 +167,9 @@ internal fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onCli
166
167
  }
167
168
  }
168
169
 
170
+ //TODO add internal
169
171
  @Composable
170
- internal fun ErrorView(errorMessage: String, errorSpacing: Boolean, hintText: String) {
172
+ fun ErrorView(errorMessage: String, errorSpacing: Boolean, hintText: String) {
171
173
  val theme = AppTheme.current
172
174
  val errorColor = remember(theme) { theme.colors.error.primary }
173
175
  val hintColor = remember(theme) { theme.colors.text.hint }
@@ -46,8 +46,9 @@ import vn.momo.kits.const.Typography
46
46
  import vn.momo.kits.const.scaleSize
47
47
  import vn.momo.kits.modifier.conditional
48
48
 
49
+ //TODO add internal
49
50
  @Composable
50
- internal fun OTPCaret() {
51
+ fun OTPCaret() {
51
52
  val duration = 500
52
53
  val backgroundColor = AppTheme.current.colors.primary
53
54
 
@@ -1,6 +1,7 @@
1
1
  package vn.momo.kits.const
2
2
 
3
3
  import androidx.compose.runtime.Stable
4
+ import androidx.compose.runtime.mutableStateOf
4
5
  import androidx.compose.runtime.staticCompositionLocalOf
5
6
  import androidx.compose.ui.graphics.Color
6
7
  import androidx.compose.ui.unit.dp
@@ -101,7 +101,7 @@ fun Header(onBackHandler: (() -> Unit)? = null) {
101
101
  onBackHandler?.invoke() ?: navigator.onBackSafe { }
102
102
  }
103
103
  )
104
- Spacer(Modifier.width(Spacing.M))
104
+ Spacer(Modifier.width(Spacing.S))
105
105
  }
106
106
 
107
107
  HeaderContent(
@@ -18,45 +18,4 @@ fun getResource(name: String): DrawableResource {
18
18
  "drawable:$name",
19
19
  setOf(ResourceItem(setOf(), "drawable/$name", -1, -1))
20
20
  )
21
- }
22
-
23
- @OptIn(InternalResourceApi::class)
24
- @Composable
25
- fun readJson(name: String): String {
26
- val path = name.plus(".json")
27
-
28
- val jsonContent by rememberState(path, { "" }) {
29
- val cached = resourceCache.getOrPut(path) {
30
- val content = try {
31
- readResourceBytes(path).decodeToString()
32
- } catch (_: Exception) {
33
- ""
34
- }
35
- ResourceCache.JSON(content)
36
- } as ResourceCache.JSON
37
-
38
- cached.json
39
- }
40
-
41
- return jsonContent
42
- }
43
-
44
-
45
- private val resourceCache = mutableMapOf<String, ResourceCache>()
46
-
47
- private sealed interface ResourceCache {
48
- class JSON(val json: String) : ResourceCache
49
- }
50
-
51
- @Composable
52
- fun <T> rememberState(
53
- key: Any,
54
- getDefault: () -> T,
55
- block: suspend () -> T
56
- ): MutableState<T> {
57
- val state = remember(key) { mutableStateOf(getDefault()) }
58
- LaunchedEffect(key) {
59
- state.value = block()
60
- }
61
- return state
62
21
  }
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.157.1-test.1
21
+ version=0.157.1-test.2
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.157.1-test.1-debug",
3
+ "version": "0.157.1-test.2-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},