@momo-kits/native-kits 0.89.31-beta.22 → 0.89.32-nav.1
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.
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +30 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +1 -4
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -6
- package/package.json +1 -1
|
@@ -3,12 +3,9 @@ package vn.momo.kits.platform
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.content.res.Resources
|
|
5
5
|
import android.graphics.BlurMaskFilter
|
|
6
|
-
import androidx.compose.foundation.layout.WindowInsets
|
|
7
|
-
import androidx.compose.foundation.layout.navigationBars
|
|
8
6
|
import androidx.compose.runtime.Composable
|
|
9
7
|
import androidx.compose.ui.graphics.NativePaint
|
|
10
8
|
import androidx.compose.ui.platform.LocalConfiguration
|
|
11
|
-
import androidx.compose.ui.platform.LocalDensity
|
|
12
9
|
import androidx.compose.ui.unit.Dp
|
|
13
10
|
import androidx.compose.ui.unit.dp
|
|
14
11
|
|
|
@@ -37,11 +34,4 @@ actual fun getStatusBarHeight(): Dp {
|
|
|
37
34
|
"android"
|
|
38
35
|
)
|
|
39
36
|
return if(resourceId > 0) Resources.getSystem().getDimensionPixelSize(resourceId).dp else 0.dp
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@Composable
|
|
43
|
-
actual fun getNavigationBarHeight(): Dp {
|
|
44
|
-
val density = LocalDensity.current
|
|
45
|
-
val navigationBarHeight = WindowInsets.navigationBars.getBottom(density)
|
|
46
|
-
return navigationBarHeight.dp
|
|
47
37
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package vn.momo.kits.components
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
|
-
import androidx.compose.foundation.border
|
|
5
4
|
import androidx.compose.foundation.clickable
|
|
6
5
|
import androidx.compose.foundation.layout.Arrangement
|
|
7
6
|
import androidx.compose.foundation.layout.Column
|
|
@@ -9,9 +8,7 @@ import androidx.compose.foundation.layout.Row
|
|
|
9
8
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
10
9
|
import androidx.compose.foundation.layout.height
|
|
11
10
|
import androidx.compose.foundation.layout.padding
|
|
12
|
-
import androidx.compose.foundation.layout.size
|
|
13
11
|
import androidx.compose.foundation.layout.width
|
|
14
|
-
import androidx.compose.foundation.shape.CircleShape
|
|
15
12
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
13
|
import androidx.compose.material.Text
|
|
17
14
|
import androidx.compose.runtime.Composable
|
|
@@ -29,7 +26,11 @@ val defaultBanner = TrustBannerData(
|
|
|
29
26
|
"vi" to "Bảo mật thông tin & An toàn tài sản của bạn là ưu tiên hàng đầu của MoMo.",
|
|
30
27
|
"en" to "Your data security and money safety are MoMo's top priorities."
|
|
31
28
|
),
|
|
32
|
-
|
|
29
|
+
subContent = mapOf(
|
|
30
|
+
"vi" to "Tìm hiểu thêm",
|
|
31
|
+
"en" to "Learn more"
|
|
32
|
+
),
|
|
33
|
+
pciImage = "https://static.momocdn.net/app/img/kits/trustBanner/pci_dss.png",
|
|
33
34
|
sslImage = "https://static.momocdn.net/app/img/kits/trustBanner/ssl.png",
|
|
34
35
|
urlConfig = "login_and_security",
|
|
35
36
|
icons = listOf(
|
|
@@ -38,40 +39,23 @@ val defaultBanner = TrustBannerData(
|
|
|
38
39
|
"https://static.momocdn.net/app/img/kits/trustBanner/ic_vietcombank.png",
|
|
39
40
|
"https://static.momocdn.net/app/img/kits/trustBanner/ic_bidv.png"
|
|
40
41
|
),
|
|
41
|
-
momoImage = "https://static.momocdn.net/app/img/kits/trustBanner/
|
|
42
|
+
momoImage = "https://static.momocdn.net/app/img/kits/trustBanner/ic_secu.png"
|
|
42
43
|
)
|
|
43
44
|
|
|
44
|
-
const val borderColor = 0xFFE8E8E8
|
|
45
|
-
const val tonalColor = 0xFFFDEAF4
|
|
46
45
|
const val backgroundBlue = 0xFFF2F8FF
|
|
47
46
|
const val contentColor = 0xFF484848
|
|
48
|
-
const val
|
|
49
|
-
|
|
50
|
-
data class TrustBannerClass(
|
|
51
|
-
val trustBanner: TrustBannerData
|
|
52
|
-
)
|
|
47
|
+
const val subContentColor = 0xFFEB2F96
|
|
53
48
|
|
|
54
49
|
data class TrustBannerData(
|
|
55
50
|
val content: Map<String, String>,
|
|
51
|
+
val subContent: Map<String, String>,
|
|
56
52
|
val pciImage: String,
|
|
53
|
+
val momoImage: String,
|
|
57
54
|
val sslImage: String,
|
|
58
55
|
val icons: List<String>,
|
|
59
|
-
val momoImage: String,
|
|
60
56
|
val urlConfig: String
|
|
61
57
|
)
|
|
62
58
|
|
|
63
|
-
@Composable
|
|
64
|
-
fun Avatar(iconURL: String) {
|
|
65
|
-
Image(
|
|
66
|
-
source = iconURL,
|
|
67
|
-
modifier = Modifier
|
|
68
|
-
.size(24.dp)
|
|
69
|
-
.background(Color.White, CircleShape)
|
|
70
|
-
.border(width = 1.dp, color = Color(borderColor), CircleShape),
|
|
71
|
-
options = Options(contentScale = ContentScale.Fit)
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
59
|
@Composable
|
|
76
60
|
fun TrustBanner(
|
|
77
61
|
trustBanner: TrustBannerData = defaultBanner,
|
|
@@ -80,6 +64,7 @@ fun TrustBanner(
|
|
|
80
64
|
onPress: ((Map<String, String>) -> Unit)? = null,
|
|
81
65
|
trackEvent: ((String, Map<String, String>) -> Unit)? = null,
|
|
82
66
|
language: String = "vi"
|
|
67
|
+
|
|
83
68
|
) {
|
|
84
69
|
val trackParams = mapOf(
|
|
85
70
|
"service_name" to serviceName,
|
|
@@ -123,12 +108,11 @@ fun TrustBanner(
|
|
|
123
108
|
modifier = Modifier
|
|
124
109
|
.width(64.dp)
|
|
125
110
|
.height(64.dp)
|
|
126
|
-
.padding(end = 8.dp),
|
|
127
|
-
options = Options(
|
|
128
|
-
contentScale = ContentScale.Fit,
|
|
129
|
-
)
|
|
130
111
|
)
|
|
131
|
-
Column
|
|
112
|
+
Column (
|
|
113
|
+
modifier = Modifier
|
|
114
|
+
.padding(start = 10.dp)
|
|
115
|
+
) {
|
|
132
116
|
Text(
|
|
133
117
|
text = trustBanner.content[language] ?: "",
|
|
134
118
|
modifier = Modifier.padding(bottom = 8.dp),
|
|
@@ -138,11 +122,26 @@ fun TrustBanner(
|
|
|
138
122
|
maxLines = 2
|
|
139
123
|
)
|
|
140
124
|
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
|
|
125
|
+
Row (
|
|
126
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
127
|
+
) {
|
|
128
|
+
Text(
|
|
129
|
+
text = trustBanner.subContent[language] ?: "",
|
|
130
|
+
lineHeight = 16.sp,
|
|
131
|
+
fontSize = 12.sp,
|
|
132
|
+
color = Color(subContentColor),
|
|
133
|
+
maxLines = 2
|
|
134
|
+
)
|
|
135
|
+
Icon(
|
|
136
|
+
source = "https://img.mservice.io/momo_app_v2/new_version/img/appx_icon/16_arrow_chevron_right_small.png",
|
|
137
|
+
color = Color(subContentColor),
|
|
138
|
+
)
|
|
139
|
+
}
|
|
141
140
|
Row {
|
|
142
141
|
Image(
|
|
143
142
|
source = trustBanner.pciImage, modifier = Modifier
|
|
144
143
|
.padding(end = 4.dp)
|
|
145
|
-
.width(
|
|
144
|
+
.width(27.dp)
|
|
146
145
|
.height(20.dp)
|
|
147
146
|
,options = Options(
|
|
148
147
|
contentScale = ContentScale.Fit,
|
|
@@ -157,31 +156,6 @@ fun TrustBanner(
|
|
|
157
156
|
)
|
|
158
157
|
)
|
|
159
158
|
}
|
|
160
|
-
Row(
|
|
161
|
-
modifier = Modifier
|
|
162
|
-
.width(96.dp)
|
|
163
|
-
.height(24.dp),
|
|
164
|
-
horizontalArrangement = Arrangement.spacedBy((-6).dp)
|
|
165
|
-
) {
|
|
166
|
-
trustBanner.icons.forEach { iconURL ->
|
|
167
|
-
Avatar(iconURL = iconURL)
|
|
168
|
-
}
|
|
169
|
-
Row(
|
|
170
|
-
modifier = Modifier
|
|
171
|
-
.size(24.dp)
|
|
172
|
-
.background(color = Color(tonalColor), CircleShape)
|
|
173
|
-
.border(width = 1.dp, color = Color(borderColor), CircleShape),
|
|
174
|
-
verticalAlignment = Alignment.CenterVertically,
|
|
175
|
-
horizontalArrangement = Arrangement.Center
|
|
176
|
-
) {
|
|
177
|
-
Text(
|
|
178
|
-
text = "36+",
|
|
179
|
-
color = Color(primaryColor),
|
|
180
|
-
lineHeight = 14.sp,
|
|
181
|
-
fontSize = 10.sp
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
159
|
}
|
|
186
160
|
}
|
|
187
161
|
}
|
|
@@ -19,7 +19,4 @@ expect fun getScreenDimensions(): ScreenDimension
|
|
|
19
19
|
expect fun NativePaint.setMaskFilter(blurRadius: Float)
|
|
20
20
|
|
|
21
21
|
@Composable
|
|
22
|
-
expect fun getStatusBarHeight(): Dp
|
|
23
|
-
|
|
24
|
-
@Composable
|
|
25
|
-
expect fun getNavigationBarHeight(): Dp
|
|
22
|
+
expect fun getStatusBarHeight(): Dp
|
|
@@ -4,7 +4,6 @@ import androidx.compose.foundation.ExperimentalFoundationApi
|
|
|
4
4
|
import androidx.compose.foundation.gestures.optOutOfCupertinoOverscroll
|
|
5
5
|
import androidx.compose.foundation.layout.WindowInsets
|
|
6
6
|
import androidx.compose.foundation.layout.asPaddingValues
|
|
7
|
-
import androidx.compose.foundation.layout.navigationBars
|
|
8
7
|
import androidx.compose.foundation.layout.systemBars
|
|
9
8
|
import androidx.compose.runtime.Composable
|
|
10
9
|
import androidx.compose.ui.graphics.NativePaint
|
|
@@ -43,9 +42,4 @@ actual fun NativePaint.setMaskFilter(blurRadius: Float) {
|
|
|
43
42
|
@Composable
|
|
44
43
|
actual fun getStatusBarHeight(): Dp {
|
|
45
44
|
return WindowInsets.systemBars.asPaddingValues().calculateTopPadding()
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@Composable
|
|
49
|
-
actual fun getNavigationBarHeight(): Dp {
|
|
50
|
-
return WindowInsets.navigationBars.asPaddingValues().calculateTopPadding()
|
|
51
45
|
}
|