Skip to content

Commit 0445c72

Browse files
Merge pull request #122 from btoms20/theme-fixes
Theme fixes
2 parents 0ee75e9 + 16d70f4 commit 0445c72

File tree

10 files changed

+77
-34
lines changed

10 files changed

+77
-34
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/ChatExample.xcodeproj/project.pbxproj

-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@
429429
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
430430
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
431431
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
432-
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
433432
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
434433
LD_RUNPATH_SEARCH_PATHS = (
435434
"$(inherited)",
@@ -467,7 +466,6 @@
467466
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
468467
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
469468
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
470-
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
471469
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
472470
LD_RUNPATH_SEARCH_PATHS = (
473471
"$(inherited)",

Package.resolved

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"pins" : [
3+
{
4+
"identity" : "activityindicatorview",
5+
"kind" : "remoteSourceControl",
6+
"location" : "https://github.com/exyte/ActivityIndicatorView",
7+
"state" : {
8+
"revision" : "9970fd0bb7a05dad0b6566ae1f56937716686b24",
9+
"version" : "1.1.1"
10+
}
11+
},
12+
{
13+
"identity" : "floatingbutton",
14+
"kind" : "remoteSourceControl",
15+
"location" : "https://github.com/exyte/FloatingButton",
16+
"state" : {
17+
"revision" : "cf77c2f124df1423d90a9a1985e9b9ccfa4b9b3e",
18+
"version" : "1.3.0"
19+
}
20+
},
21+
{
22+
"identity" : "mediapicker",
23+
"kind" : "remoteSourceControl",
24+
"location" : "https://github.com/exyte/MediaPicker.git",
25+
"state" : {
26+
"revision" : "88769b1b69c2b5e5fa5b65522c08bc7b667a6cb8",
27+
"version" : "2.2.3"
28+
}
29+
},
30+
{
31+
"identity" : "swiftui-introspect",
32+
"kind" : "remoteSourceControl",
33+
"location" : "https://github.com/siteline/swiftui-introspect",
34+
"state" : {
35+
"revision" : "807f73ce09a9b9723f12385e592b4e0aaebd3336",
36+
"version" : "1.3.0"
37+
}
38+
}
39+
],
40+
"version" : 2
41+
}

Sources/ExyteChat/ChatView/Attachments/AttachmentsEditor.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ struct AttachmentsEditor<InputViewContent: View>: View {
103103
fullscreenPhotoBackground: theme.colors.mainBG,
104104
cameraBackground: theme.colors.mainBG,
105105
cameraSelectionBackground: theme.colors.mainBG),
106-
selection: .init(selectedTint: theme.colors.sendButtonBackground)
106+
selection: .init(
107+
selectedTint: theme.colors.sendButtonBackground,
108+
fullscreenTint: theme.colors.sendButtonBackground
109+
)
107110
)
108111
}
109112
}

Sources/ExyteChat/ChatView/Attachments/FullscreenMediaPages.swift

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ struct FullscreenMediaPages: View {
105105
if viewModel.showMinis {
106106
Button(action: onClose) {
107107
theme.images.mediaPicker.cross
108+
.imageScale(.large)
108109
.padding(5)
109110
}
110111
.tint(.white)

Sources/ExyteChat/ChatView/ChatView.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public struct ChatView<MessageContent: View, InputViewContent: View, MenuAction:
222222
var waitingForNetwork: some View {
223223
VStack {
224224
Rectangle()
225-
.foregroundColor(.black.opacity(0.12))
225+
.foregroundColor(theme.colors.mainText.opacity(0.12))
226226
.frame(height: 1)
227227
HStack {
228228
Spacer()
@@ -232,7 +232,7 @@ public struct ChatView<MessageContent: View, InputViewContent: View, MenuAction:
232232
}
233233
.padding(.top, 6)
234234
Rectangle()
235-
.foregroundColor(.black.opacity(0.12))
235+
.foregroundColor(theme.colors.mainText.opacity(0.12))
236236
.frame(height: 1)
237237
}
238238
.padding(.top, 8)
@@ -252,6 +252,8 @@ public struct ChatView<MessageContent: View, InputViewContent: View, MenuAction:
252252
theme.images.scrollToBottom
253253
.frame(width: 40, height: 40)
254254
.circleBackground(theme.colors.messageFriendBG)
255+
.foregroundStyle(theme.colors.sendButtonBackground)
256+
.shadow(color: .primary.opacity(0.1), radius: 2, y: 1)
255257
}
256258
.padding(8)
257259
}
@@ -382,6 +384,7 @@ public struct ChatView<MessageContent: View, InputViewContent: View, MenuAction:
382384
alignment: row.message.user.isCurrentUser ? .right : .left,
383385
leadingPadding: avatarSize + MessageView.horizontalAvatarPadding * 2,
384386
trailingPadding: MessageView.statusViewSize + MessageView.horizontalStatusPadding,
387+
font: messageFont,
385388
onAction: menuActionClosure(row.message)) {
386389
ChatMessageView(viewModel: viewModel, messageBuilder: messageBuilder, row: row, chatType: type, avatarSize: avatarSize, tapAvatarClosure: nil, messageUseMarkdown: messageUseMarkdown, isDisplayingMessageMenu: true, showMessageTimeView: showMessageTimeView, messageFont: messageFont)
387390
.onTapGesture {

Sources/ExyteChat/ChatView/InputView/InputView.swift

+4
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ struct InputView: View {
277277

278278
HStack {
279279
theme.images.reply.replyToMessage
280+
.foregroundStyle(theme.colors.sendButtonBackground)
280281
Capsule()
281282
.foregroundColor(theme.colors.messageMyBG)
282283
.frame(width: 2)
@@ -312,6 +313,7 @@ struct InputView: View {
312313
.onTapGesture {
313314
viewModel.attachments.replyMessage = nil
314315
}
316+
.foregroundStyle(theme.colors.sendButtonBackground)
315317
}
316318
.padding(.horizontal, 26)
317319
}
@@ -483,6 +485,7 @@ struct InputView: View {
483485
} label: {
484486
theme.images.recordAudio.playRecord
485487
}
488+
.tint(theme.colors.mainText)
486489
}
487490

488491
var pauseRecordButton: some View {
@@ -491,6 +494,7 @@ struct InputView: View {
491494
} label: {
492495
theme.images.recordAudio.pauseRecord
493496
}
497+
.tint(theme.colors.mainText)
494498
}
495499

496500
@ViewBuilder

Sources/ExyteChat/ChatView/InputView/TextInputView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ struct TextInputView: View {
2929
.onTapGesture {
3030
globalFocusState.focus = .uuid(inputFieldId)
3131
}
32+
.tint(theme.colors.sendButtonBackground)
3233
}
3334
}

Sources/ExyteChat/ChatView/MessageView/MessageMenu.swift

+13-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public enum DefaultMessageMenuAction: MessageMenuAction {
3636
case .copy:
3737
Image(systemName: "doc.on.doc")
3838
case .reply:
39-
Image(.reply)
39+
Image(systemName: "arrowshape.turn.up.left")
4040
case .edit:
41-
Image(.edit)
41+
Image(systemName: "bubble.and.pencil")
4242
}
4343
}
4444

@@ -67,9 +67,18 @@ struct MessageMenu<MainButton: View, ActionEnum: MessageMenuAction>: View {
6767
var alignment: Alignment
6868
var leadingPadding: CGFloat
6969
var trailingPadding: CGFloat
70+
var font: UIFont? = nil
7071
var onAction: (ActionEnum) -> ()
7172
var mainButton: () -> MainButton
7273

74+
var getFont: Font? {
75+
if let font {
76+
return Font(font)
77+
} else {
78+
return nil
79+
}
80+
}
81+
7382
var body: some View {
7483
FloatingButton(
7584
mainButtonView: mainButton().allowsHitTesting(false),
@@ -95,7 +104,7 @@ struct MessageMenu<MainButton: View, ActionEnum: MessageMenuAction>: View {
95104
}
96105

97106
ZStack {
98-
theme.colors.menuBG
107+
theme.colors.messageFriendBG
99108
.cornerRadius(12)
100109
HStack {
101110
Text(title)
@@ -105,6 +114,7 @@ struct MessageMenu<MainButton: View, ActionEnum: MessageMenuAction>: View {
105114
.renderingMode(.template)
106115
.foregroundStyle(theme.colors.menuText)
107116
}
117+
.font(getFont)
108118
.padding(.vertical, 11)
109119
.padding(.horizontal, 12)
110120
}

Sources/ExyteChat/Theme/ChatTheme.swift

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// ChatTheme.swift
3-
//
3+
//
44
//
55
// Created by Alisa Mylnikova on 31.01.2023.
66
//
@@ -158,15 +158,6 @@ public struct ChatTheme {
158158
public var sending: Image
159159
}
160160

161-
public struct MessageMenu {
162-
public var delete: Image
163-
public var edit: Image
164-
public var forward: Image
165-
public var retry: Image
166-
public var save: Image
167-
public var select: Image
168-
}
169-
170161
public struct RecordAudio {
171162
public var cancelRecord: Image
172163
public var deleteRecord: Image
@@ -190,7 +181,6 @@ public struct ChatTheme {
190181
public var fullscreenMedia: FullscreenMedia
191182
public var mediaPicker: MediaPicker
192183
public var message: Message
193-
public var messageMenu: MessageMenu
194184
public var recordAudio: RecordAudio
195185
public var reply: Reply
196186

@@ -224,12 +214,6 @@ public struct ChatTheme {
224214
playAudio: Image? = nil,
225215
playVideo: Image? = nil,
226216
sending: Image? = nil,
227-
delete: Image? = nil,
228-
edit: Image? = nil,
229-
forward: Image? = nil,
230-
retry: Image? = nil,
231-
save: Image? = nil,
232-
select: Image? = nil,
233217
cancelRecord: Image? = nil,
234218
deleteRecord: Image? = nil,
235219
lockRecord: Image? = nil,
@@ -289,15 +273,6 @@ public struct ChatTheme {
289273
sending: sending ?? Image("sending", bundle: .current)
290274
)
291275

292-
self.messageMenu = MessageMenu(
293-
delete: delete ?? Image("delete", bundle: .current),
294-
edit: edit ?? Image("edit", bundle: .current),
295-
forward: forward ?? Image("forward", bundle: .current),
296-
retry: retry ?? Image("retry", bundle: .current),
297-
save: save ?? Image("save", bundle: .current),
298-
select: select ?? Image("select", bundle: .current)
299-
)
300-
301276
self.recordAudio = RecordAudio(
302277
cancelRecord: cancelRecord ?? Image("cancelRecord", bundle: .current),
303278
deleteRecord: deleteRecord ?? Image("deleteRecord", bundle: .current),

0 commit comments

Comments
 (0)