@momo-kits/native-kits 0.117.1-beta.6 → 0.117.1-beta.7
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.
|
@@ -85,7 +85,9 @@ public struct HeaderBackground: View {
|
|
|
85
85
|
endPoint: .bottom))
|
|
86
86
|
.opacity(opacity)
|
|
87
87
|
.frame(height: height))
|
|
88
|
-
.overlay(
|
|
88
|
+
.overlay(
|
|
89
|
+
isTransparent ? nil :
|
|
90
|
+
Rectangle()
|
|
89
91
|
.fill(Colors.black04)
|
|
90
92
|
.frame(height: 1)
|
|
91
93
|
.frame(maxWidth: .infinity)
|
|
@@ -154,9 +156,8 @@ public struct Header: View {
|
|
|
154
156
|
|
|
155
157
|
public var body: some View {
|
|
156
158
|
|
|
157
|
-
|
|
158
|
-
let
|
|
159
|
-
let borderColor: Color = tintColor == Colors.black01 ? Color.black.opacity(0.6) : Color.black.opacity(0.2)
|
|
159
|
+
let backgroundButtonColor: Color = tintColor == Colors.black01 ? Color.black.opacity(0.6) : Colors.black01.opacity(0.6)
|
|
160
|
+
let borderColor: Color = tintColor == Colors.black01 ? Color.white.opacity(0.2) : Color.black.opacity(0.2)
|
|
160
161
|
|
|
161
162
|
if headerType != .none {
|
|
162
163
|
VStack(spacing: 0) {
|
|
@@ -166,7 +167,7 @@ public struct Header: View {
|
|
|
166
167
|
SwiftUI.Button(action: goBack) {
|
|
167
168
|
Circle()
|
|
168
169
|
.stroke(borderColor, lineWidth: 0.2)
|
|
169
|
-
.background(Circle().fill(
|
|
170
|
+
.background(Circle().fill(backgroundButtonColor))
|
|
170
171
|
.frame(width: 28, height: 28)
|
|
171
172
|
.overlay(
|
|
172
173
|
Icon(source: "arrow-back", size: 20, color: tintColor)
|
|
@@ -213,8 +214,9 @@ public struct Header: View {
|
|
|
213
214
|
}
|
|
214
215
|
} else {
|
|
215
216
|
Text(title)
|
|
216
|
-
.font(Font.system(size: 17).weight(.bold))
|
|
217
|
-
.
|
|
217
|
+
.font(Font.system(size: 17).weight(.bold))
|
|
218
|
+
.lineSpacing(22)
|
|
219
|
+
.foregroundColor(tintColor)
|
|
218
220
|
.frame(maxWidth: titlePosition == .center ? UIScreen.main.bounds.width - 252 : nil)
|
|
219
221
|
.frame(maxWidth: titlePosition == .center ? .infinity : UIScreen.main.bounds.width - 172, alignment: titlePosition == .center ? .center : .leading)
|
|
220
222
|
.lineLimit(1)
|
|
@@ -75,20 +75,23 @@ struct NavigationButtonConfig {
|
|
|
75
75
|
|
|
76
76
|
// MARK: - Components
|
|
77
77
|
public struct HeaderRight: View {
|
|
78
|
-
public init(headerRight: HeaderRightData? = nil) {
|
|
78
|
+
public init(headerRight: HeaderRightData? = nil, tintColor: Color? = nil) {
|
|
79
79
|
self.headerRight = headerRight
|
|
80
|
+
self.tintColor = tintColor
|
|
80
81
|
}
|
|
81
82
|
var headerRight: HeaderRightData?
|
|
83
|
+
var tintColor: Color? = nil
|
|
82
84
|
|
|
83
85
|
public var body: some View {
|
|
84
86
|
HStack(alignment: .center) {
|
|
85
|
-
ToolkitHeaderRight(headerRight: headerRight)
|
|
87
|
+
ToolkitHeaderRight(headerRight: headerRight, tintColor: tintColor)
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
struct ToolkitHeaderRight: View {
|
|
91
93
|
var headerRight: HeaderRightData?
|
|
94
|
+
var tintColor: Color?
|
|
92
95
|
@State private var isFavorite: Bool = false
|
|
93
96
|
@State private var isLoading: Bool = false
|
|
94
97
|
@EnvironmentObject private var environment: ApplicationEnvironment
|
|
@@ -176,6 +179,8 @@ struct ToolkitHeaderRight: View {
|
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
var body: some View {
|
|
182
|
+
let backgroundButtonColor: Color = tintColor == Colors.black01 ? Color.black.opacity(0.6) : Colors.black01.opacity(0.6)
|
|
183
|
+
let borderColor: Color = tintColor == Colors.black01 ? Color.white.opacity(0.2) : Color.black.opacity(0.2)
|
|
179
184
|
let navButtonConfig = getNavigationButtonConfig()
|
|
180
185
|
let showBadge = headerRight?.tools.contains { group in
|
|
181
186
|
group.items.contains { $0.showBadge }
|
|
@@ -187,33 +192,34 @@ struct ToolkitHeaderRight: View {
|
|
|
187
192
|
disabled: isLoading,
|
|
188
193
|
icon: navButtonConfig.icon,
|
|
189
194
|
showBadge: showBadge,
|
|
190
|
-
onClick: navButtonConfig.onPress
|
|
195
|
+
onClick: navButtonConfig.onPress,
|
|
196
|
+
tintColor: tintColor
|
|
191
197
|
)
|
|
192
198
|
}
|
|
193
199
|
|
|
194
200
|
HStack(alignment: .center, spacing: 0) {
|
|
195
|
-
Icon(source: "help_center", size: 20)
|
|
201
|
+
Icon(source: "help_center", size: 20, color: tintColor ?? Colors.black17)
|
|
196
202
|
.padding(4)
|
|
197
203
|
.onTapGesture {
|
|
198
204
|
onPressHelpCenter()
|
|
199
205
|
}
|
|
200
206
|
|
|
201
207
|
Rectangle()
|
|
202
|
-
.fill(Colors.black20)
|
|
208
|
+
.fill(tintColor ?? Colors.black20)
|
|
203
209
|
.frame(width: 0.5, height: 12)
|
|
204
210
|
|
|
205
|
-
Icon(source: "16_navigation_close_circle", size: 20, color: Colors.black17)
|
|
211
|
+
Icon(source: "16_navigation_close_circle", size: 20, color: tintColor ?? Colors.black17)
|
|
206
212
|
.padding(4)
|
|
207
213
|
.onTapGesture {
|
|
208
214
|
onPressClose()
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
217
|
.frame(width: 65, height: 28)
|
|
212
|
-
.background(
|
|
218
|
+
.background(backgroundButtonColor)
|
|
213
219
|
.cornerRadius(14)
|
|
214
220
|
.overlay(
|
|
215
221
|
RoundedRectangle(cornerRadius: 14)
|
|
216
|
-
.stroke(
|
|
222
|
+
.stroke(borderColor, lineWidth: 0.2)
|
|
217
223
|
)
|
|
218
224
|
.padding(.leading, Spacing.S)
|
|
219
225
|
}
|
|
@@ -225,17 +231,21 @@ struct NavigationButton: View {
|
|
|
225
231
|
var icon: String
|
|
226
232
|
var showBadge: Bool
|
|
227
233
|
var onClick: () -> Void
|
|
234
|
+
var tintColor: Color?
|
|
228
235
|
|
|
229
236
|
var body: some View {
|
|
237
|
+
let backgroundButtonColor: Color = tintColor == Colors.black01 ? Color.black.opacity(0.6) : Colors.black01.opacity(0.6)
|
|
238
|
+
let borderColor: Color = tintColor == Colors.black01 ? Color.white.opacity(0.2) : Color.black.opacity(0.2)
|
|
239
|
+
|
|
230
240
|
ZStack {
|
|
231
241
|
Circle()
|
|
232
|
-
.fill(
|
|
242
|
+
.fill(backgroundButtonColor)
|
|
233
243
|
.overlay(
|
|
234
244
|
Circle()
|
|
235
|
-
.stroke(
|
|
245
|
+
.stroke(borderColor, lineWidth: 0.2)
|
|
236
246
|
)
|
|
237
247
|
|
|
238
|
-
Icon(source: icon, size: 16)
|
|
248
|
+
Icon(source: icon, size: 16, color: tintColor)
|
|
239
249
|
|
|
240
250
|
if showBadge {
|
|
241
251
|
BadgeDot(size: .small)
|
|
@@ -76,6 +76,9 @@ public struct Screen<Content: View>: View {
|
|
|
76
76
|
@State private var scrollOffset: CGFloat = 0
|
|
77
77
|
|
|
78
78
|
public var body: some View {
|
|
79
|
+
|
|
80
|
+
let headerRightInstance = {HeaderRight(tintColor: tintColor)}
|
|
81
|
+
|
|
79
82
|
GeometryReader { geometry in
|
|
80
83
|
let topInset = geometry.safeAreaInsets.top
|
|
81
84
|
let keyboardHeight: CGFloat = 0
|
|
@@ -101,7 +104,7 @@ public struct Screen<Content: View>: View {
|
|
|
101
104
|
headerType: headerType,
|
|
102
105
|
titlePosition: titlePosition,
|
|
103
106
|
title: title,
|
|
104
|
-
headerRight:
|
|
107
|
+
headerRight: headerRightInstance,
|
|
105
108
|
goBack: goBack,
|
|
106
109
|
opacity: min(scrollOffset / 114, 1),
|
|
107
110
|
animatedHeader: animatedHeader,
|
package/ios/Image/Image.swift
CHANGED
|
@@ -27,7 +27,7 @@ public struct ImageView: View {
|
|
|
27
27
|
error = false
|
|
28
28
|
}
|
|
29
29
|
.resizable()
|
|
30
|
-
.renderingMode(.original)
|
|
30
|
+
.renderingMode(color != nil ? .template : .original)
|
|
31
31
|
.placeholder {
|
|
32
32
|
Rectangle().foregroundColor(.gray)
|
|
33
33
|
VStack(alignment: .center, content: {
|
|
@@ -49,7 +49,7 @@ public struct ImageView: View {
|
|
|
49
49
|
.scaledToFit()
|
|
50
50
|
.transition(.fade)
|
|
51
51
|
.aspectRatio(aspectRatio, contentMode: contentMode)
|
|
52
|
-
.
|
|
52
|
+
.foregroundColor(color)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// MARK: Internal
|
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
|
+
#Thu Jan 09 10:43:10 ICT 2025
|
|
8
|
+
sdk.dir=/Users/sophia/Library/Android/sdk
|