@momo-kits/native-kits 0.153.1-beta.5 → 0.153.1-scaleSize.2
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.
|
@@ -29,7 +29,7 @@ import vn.momo.uikits.resources.sfprotext_thin
|
|
|
29
29
|
import vn.momo.uikits.resources.sfprotext_ultralight
|
|
30
30
|
|
|
31
31
|
const val DEFAULT_SCREEN_SIZE = 375f
|
|
32
|
-
const val MAX_FONT_SCALE = 1.
|
|
32
|
+
const val MAX_FONT_SCALE = 1.25f
|
|
33
33
|
const val MAX_DEVICE_SCALE = 5
|
|
34
34
|
|
|
35
35
|
@Composable
|
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
2
|
|
|
3
|
+
// MARK: - Custom Shape for Rounded Corners
|
|
4
|
+
struct RoundedCorners: Shape {
|
|
5
|
+
var topLeft: CGFloat = 0.0
|
|
6
|
+
var topRight: CGFloat = 0.0
|
|
7
|
+
var bottomLeft: CGFloat = 0.0
|
|
8
|
+
var bottomRight: CGFloat = 0.0
|
|
9
|
+
|
|
10
|
+
func path(in rect: CGRect) -> Path {
|
|
11
|
+
var path = Path()
|
|
12
|
+
|
|
13
|
+
let width = rect.size.width
|
|
14
|
+
let height = rect.size.height
|
|
15
|
+
|
|
16
|
+
// Start from top left
|
|
17
|
+
path.move(to: CGPoint(x: topLeft, y: 0))
|
|
18
|
+
|
|
19
|
+
// Top edge and top right corner
|
|
20
|
+
path.addLine(to: CGPoint(x: width - topRight, y: 0))
|
|
21
|
+
if topRight > 0 {
|
|
22
|
+
path.addArc(
|
|
23
|
+
center: CGPoint(x: width - topRight, y: topRight),
|
|
24
|
+
radius: topRight,
|
|
25
|
+
startAngle: Angle(degrees: -90),
|
|
26
|
+
endAngle: Angle(degrees: 0),
|
|
27
|
+
clockwise: false
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Right edge and bottom right corner
|
|
32
|
+
path.addLine(to: CGPoint(x: width, y: height - bottomRight))
|
|
33
|
+
if bottomRight > 0 {
|
|
34
|
+
path.addArc(
|
|
35
|
+
center: CGPoint(x: width - bottomRight, y: height - bottomRight),
|
|
36
|
+
radius: bottomRight,
|
|
37
|
+
startAngle: Angle(degrees: 0),
|
|
38
|
+
endAngle: Angle(degrees: 90),
|
|
39
|
+
clockwise: false
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Bottom edge and bottom left corner
|
|
44
|
+
path.addLine(to: CGPoint(x: bottomLeft, y: height))
|
|
45
|
+
if bottomLeft > 0 {
|
|
46
|
+
path.addArc(
|
|
47
|
+
center: CGPoint(x: bottomLeft, y: height - bottomLeft),
|
|
48
|
+
radius: bottomLeft,
|
|
49
|
+
startAngle: Angle(degrees: 90),
|
|
50
|
+
endAngle: Angle(degrees: 180),
|
|
51
|
+
clockwise: false
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Left edge and top left corner
|
|
56
|
+
path.addLine(to: CGPoint(x: 0, y: topLeft))
|
|
57
|
+
if topLeft > 0 {
|
|
58
|
+
path.addArc(
|
|
59
|
+
center: CGPoint(x: topLeft, y: topLeft),
|
|
60
|
+
radius: topLeft,
|
|
61
|
+
startAngle: Angle(degrees: 180),
|
|
62
|
+
endAngle: Angle(degrees: 270),
|
|
63
|
+
clockwise: false
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
path.closeSubpath()
|
|
68
|
+
return path
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
3
72
|
public enum RibbonPosition {
|
|
4
73
|
case topLeft
|
|
5
74
|
case topRight
|
|
@@ -76,14 +145,13 @@ public struct BadgeRibbon: View {
|
|
|
76
145
|
.frame(height: RibbonConstants.roundHeight)
|
|
77
146
|
.padding(.trailing, RibbonConstants.roundPaddingEnd)
|
|
78
147
|
.background(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
)
|
|
148
|
+
RoundedCorners(
|
|
149
|
+
topLeft: 0,
|
|
150
|
+
topRight: RibbonConstants.roundRightRadius,
|
|
151
|
+
bottomLeft: 0,
|
|
152
|
+
bottomRight: RibbonConstants.roundRightRadius
|
|
153
|
+
)
|
|
154
|
+
.fill(backgroundColor)
|
|
87
155
|
)
|
|
88
156
|
}
|
|
89
157
|
|
|
@@ -139,7 +207,7 @@ private struct RibbonConstants {
|
|
|
139
207
|
static let ribbonHeight: CGFloat = 20
|
|
140
208
|
static let roundHeight: CGFloat = 16
|
|
141
209
|
static let skewBodyHeight: CGFloat = 16
|
|
142
|
-
static let roundRightRadius: CGFloat =
|
|
210
|
+
static let roundRightRadius: CGFloat = 8
|
|
143
211
|
static let roundPaddingEnd: CGFloat = 6
|
|
144
212
|
static let skewTailWidth: CGFloat = 8
|
|
145
213
|
static let skewTailHeight: CGFloat = 16
|
package/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Tue Apr 08 11:13:31 ICT 2025
|
|
8
|
+
sdk.dir=/Users/sonnguyen/Library/Android/sdk
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/native-kits",
|
|
3
|
-
"version": "0.153.1-
|
|
3
|
+
"version": "0.153.1-scaleSize.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@momo-platform/native-max-api": "1.0.18"
|
|
6
|
+
"@momo-platform/native-max-api": "1.0.18-1"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {},
|
|
9
9
|
"license": "MoMo"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.navigation
|
|
2
|
-
|
|
3
|
-
import kotlinx.coroutines.flow.MutableStateFlow
|
|
4
|
-
import kotlinx.coroutines.flow.asStateFlow
|
|
5
|
-
|
|
6
|
-
// Support swipe back on iOS
|
|
7
|
-
object ComposeNavigatorManager {
|
|
8
|
-
private val _managers = MutableStateFlow<List<Navigator>>(emptyList())
|
|
9
|
-
val managers = _managers.asStateFlow()
|
|
10
|
-
|
|
11
|
-
fun push(manager: Navigator) {
|
|
12
|
-
_managers.value = _managers.value + manager
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
fun removeLast() {
|
|
16
|
-
_managers.value = _managers.value.dropLast(1)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
fun checkCanPop(): Boolean = _managers.value.isNotEmpty()
|
|
20
|
-
|
|
21
|
-
fun pop() {
|
|
22
|
-
top()?.pop()
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
private fun top(): Navigator? = _managers.value.lastOrNull()
|
|
26
|
-
}
|