@momo-kits/native-kits 0.153.1-beta.7 → 0.153.1-newsfeed.5

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.
@@ -76,7 +76,7 @@ kotlin {
76
76
  implementation(libs.coil.multiplatform.network.ktor)
77
77
  implementation(libs.jetbrains.serialization.json)
78
78
  implementation(libs.kotlinx.datetime)
79
- api(project(":NativeMaxApi"))
79
+ api(libs.native.max.api)
80
80
  }
81
81
  }
82
82
  val androidMain by getting {
@@ -0,0 +1,26 @@
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
+ }
@@ -1,74 +1,5 @@
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
-
72
3
  public enum RibbonPosition {
73
4
  case topLeft
74
5
  case topRight
@@ -145,13 +76,14 @@ public struct BadgeRibbon: View {
145
76
  .frame(height: RibbonConstants.roundHeight)
146
77
  .padding(.trailing, RibbonConstants.roundPaddingEnd)
147
78
  .background(
148
- RoundedCorners(
149
- topLeft: 0,
150
- topRight: RibbonConstants.roundRightRadius,
151
- bottomLeft: 0,
152
- bottomRight: RibbonConstants.roundRightRadius
153
- )
154
- .fill(backgroundColor)
79
+ RoundedRectangle(cornerRadius: Radius.M)
80
+ .fill(backgroundColor)
81
+ .mask(
82
+ HStack(spacing: 0) {
83
+ Rectangle()
84
+ RoundedRectangle(cornerRadius: Radius.M)
85
+ }
86
+ )
155
87
  )
156
88
  }
157
89
 
@@ -207,7 +139,7 @@ private struct RibbonConstants {
207
139
  static let ribbonHeight: CGFloat = 20
208
140
  static let roundHeight: CGFloat = 16
209
141
  static let skewBodyHeight: CGFloat = 16
210
- static let roundRightRadius: CGFloat = 8
142
+ static let roundRightRadius: CGFloat = 12
211
143
  static let roundPaddingEnd: CGFloat = 6
212
144
  static let skewTailWidth: CGFloat = 8
213
145
  static let skewTailHeight: CGFloat = 16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.153.1-beta.7",
3
+ "version": "0.153.1-newsfeed.5",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@momo-platform/native-max-api": "1.0.18"
package/local.properties DELETED
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Thu Jan 09 10:43:10 ICT 2025
8
- sdk.dir=/Users/sophia/Library/Android/sdk