-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply unified UI for SC's top banner on ChatView
- Loading branch information
1 parent
78eac29
commit 73d0cdd
Showing
22 changed files
with
246 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
GliaWidgets/Sources/EntryWidget/MediaTypeItem/MediaTypeItemStyle.Mock.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#if DEBUG | ||
import UIKit | ||
|
||
extension EntryWidgetStyle.MediaTypeItemStyle { | ||
static func mock( | ||
chatTitle: String = "Chat", | ||
audioTitle: String = "Audio", | ||
videoTitle: String = "Video", | ||
secureMessagingTitle: String = "Secure messaging", | ||
titleFont: UIFont = .systemFont(ofSize: 16), | ||
titleColor: UIColor = .black, | ||
titleTextStyle: UIFont.TextStyle = .body, | ||
chatMessage: String = "Chat message", | ||
audioMessage: String = "Audio message", | ||
videoMessage: String = "Video message", | ||
secureMessagingMessage: String = "Secure messaging message", | ||
messageFont: UIFont = .systemFont(ofSize: 16), | ||
messageColor: UIColor = .black, | ||
unreadMessagesCounterFont: UIFont = .systemFont(ofSize: 16), | ||
unreadMessagesCounterColor: UIColor = .white, | ||
unreadMessagesCounterBackgroundColor: ColorType = .fill(color: .blue), | ||
messageTextStyle: UIFont.TextStyle = .footnote, | ||
iconColor: ColorType = .fill(color: .blue), | ||
backgroundColor: ColorType = .fill(color: .white), | ||
loading: LoadingStyle = .init(loadingTintColor: .fill(color: .gray)), | ||
accessibility: Accessibility = .unsupported | ||
) -> Self { | ||
Self( | ||
chatTitle: chatTitle, | ||
audioTitle: audioTitle, | ||
videoTitle: videoTitle, | ||
secureMessagingTitle: secureMessagingTitle, | ||
titleFont: titleFont, | ||
titleColor: titleColor, | ||
titleTextStyle: titleTextStyle, | ||
chatMessage: chatMessage, | ||
audioMessage: audioMessage, | ||
videoMessage: videoMessage, | ||
secureMessagingMessage: secureMessagingMessage, | ||
messageFont: messageFont, | ||
messageColor: messageColor, | ||
unreadMessagesCounterFont: unreadMessagesCounterFont, | ||
unreadMessagesCounterColor: unreadMessagesCounterColor, | ||
unreadMessagesCounterBackgroundColor: unreadMessagesCounterBackgroundColor, | ||
messageTextStyle: messageTextStyle, | ||
iconColor: iconColor, | ||
backgroundColor: backgroundColor, | ||
loading: loading, | ||
accessibility: accessibility | ||
) | ||
} | ||
} | ||
#endif |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...rces/EntryWidget/MediaTypeItemStyle.swift → ...et/MediaTypeItem/MediaTypeItemStyle.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
GliaWidgets/Sources/EntryWidget/MediaTypeItems/MediaTypeItemsStyle.Mock.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#if DEBUG | ||
import UIKit | ||
|
||
extension EntryWidgetStyle.MediaTypeItemsStyle { | ||
static func mock( | ||
mediaItemStyle: EntryWidgetStyle.MediaTypeItemStyle = .mock(), | ||
dividerColor: UIColor = .gray | ||
) -> Self { | ||
Self( | ||
mediaItemStyle: mediaItemStyle, | ||
dividerColor: dividerColor | ||
) | ||
} | ||
} | ||
#endif |
15 changes: 15 additions & 0 deletions
15
GliaWidgets/Sources/EntryWidget/MediaTypeItems/MediaTypeItemsStyle.RemoteConfig.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import UIKit | ||
|
||
extension EntryWidgetStyle.MediaTypeItemsStyle { | ||
mutating func apply( | ||
configuration: RemoteConfiguration.MediaTypeItems?, | ||
assetBuilder: RemoteConfiguration.AssetsBuilder | ||
) { | ||
mediaItemStyle.apply(configuration: configuration?.mediaTypeItem, assetsBuilder: assetBuilder) | ||
|
||
configuration?.dividerColor?.value | ||
.map { UIColor(hex: $0) } | ||
.first | ||
.unwrap { dividerColor = $0 } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
GliaWidgets/Sources/EntryWidget/MediaTypeItems/MediaTypeItemsStyle.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import UIKit | ||
|
||
extension EntryWidgetStyle { | ||
public struct MediaTypeItemsStyle: Equatable { | ||
/// The style of media type item. | ||
public var mediaItemStyle: EntryWidgetStyle.MediaTypeItemStyle | ||
|
||
/// The color of the divider. | ||
public var dividerColor: UIColor | ||
|
||
/// - Parameters: | ||
/// - mediaItemStyle: Style of media type item.. | ||
/// - dividerColor: Color of the banner divider. | ||
public init( | ||
mediaItemStyle: EntryWidgetStyle.MediaTypeItemStyle, | ||
dividerColor: UIColor | ||
) { | ||
self.mediaItemStyle = mediaItemStyle | ||
self.dividerColor = dividerColor | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.