Various Improvements

This commit is contained in:
Ilya Laktyushin
2021-01-23 20:07:12 +03:00
parent 9a2253d7fd
commit c810233048
22 changed files with 4586 additions and 4314 deletions

View File

@@ -57,6 +57,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
private var titleLeftIcon: ChatTitleIcon = .none
private var titleRightIcon: ChatTitleIcon = .none
private var titleFakeIcon = false
private var titleScamIcon = false
//private var networkStatusNode: ChatTitleNetworkStatusNode?
@@ -104,6 +105,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
var titleLeftIcon: ChatTitleIcon = .none
var titleRightIcon: ChatTitleIcon = .none
var titleScamIcon = false
var titleFakeIcon = false
var isEnabled = true
switch titleContent {
case let .peer(peerView, _, isScheduledMessages):
@@ -129,7 +131,11 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
segments = [.text(0, NSAttributedString(string: peer.displayTitle(strings: self.strings, displayOrder: self.nameDisplayOrder), font: Font.medium(17.0), textColor: titleTheme.rootController.navigationBar.primaryTextColor))]
}
}
titleScamIcon = peer.isScam
if peer.isFake {
titleFakeIcon = true
} else if peer.isScam {
titleScamIcon = true
}
}
if peerView.peerId.namespace == Namespaces.Peer.SecretChat {
titleLeftIcon = .lock
@@ -231,6 +237,12 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
updated = true
}
if titleFakeIcon != self.titleFakeIcon {
self.titleFakeIcon = titleFakeIcon
self.titleCredibilityIconNode.image = titleFakeIcon ? PresentationResourcesChatList.fakeIcon(titleTheme, type: .regular) : nil
updated = true
}
if titleScamIcon != self.titleScamIcon {
self.titleScamIcon = titleScamIcon
self.titleCredibilityIconNode.image = titleScamIcon ? PresentationResourcesChatList.scamIcon(titleTheme, type: .regular) : nil