Skip to content

Commit 40080bb

Browse files
committed
Various fixes
1 parent 0a9f514 commit 40080bb

File tree

4 files changed

+105
-39
lines changed

4 files changed

+105
-39
lines changed

submodules/BrowserUI/Sources/BrowserWebContent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
809809
}
810810

811811
func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) {
812-
if navigationResponse.canShowMIMEType {
812+
if navigationResponse.canShowMIMEType || navigationResponse.response.url?.scheme == "tonsite" {
813813
decisionHandler(.allow)
814814
} else if #available(iOS 14.5, *) {
815815
if navigationResponse.response.suggestedFilename?.lowercased().hasSuffix(".pkpass") == true {

submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ private enum PrivacyAndSecurityEntry: ItemListNodeEntry {
169169
return 12
170170
case .bioPrivacy:
171171
return 13
172-
case .birthdayPrivacy:
173-
return 14
174172
case .giftsAutoSavePrivacy:
173+
return 14
174+
case .birthdayPrivacy:
175175
return 15
176176
case .forwardPrivacy:
177177
return 16
@@ -655,8 +655,8 @@ private func privacyAndSecurityControllerEntries(
655655
entries.append(.lastSeenPrivacy(presentationData.theme, presentationData.strings.PrivacySettings_LastSeen, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.presence)))
656656
entries.append(.profilePhotoPrivacy(presentationData.theme, presentationData.strings.Privacy_ProfilePhoto, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.profilePhoto)))
657657
entries.append(.bioPrivacy(presentationData.theme, presentationData.strings.Privacy_Bio, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.bio)))
658-
entries.append(.birthdayPrivacy(presentationData.theme, presentationData.strings.Privacy_Birthday, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.birthday)))
659658
entries.append(.giftsAutoSavePrivacy(presentationData.theme, presentationData.strings.Privacy_Gifts, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.giftsAutoSave)))
659+
entries.append(.birthdayPrivacy(presentationData.theme, presentationData.strings.Privacy_Birthday, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.birthday)))
660660
entries.append(.forwardPrivacy(presentationData.theme, presentationData.strings.Privacy_Forwards, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.forwards)))
661661
entries.append(.voiceCallPrivacy(presentationData.theme, presentationData.strings.Privacy_Calls, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.voiceCalls)))
662662
if !isPremiumDisabled {
@@ -670,8 +670,8 @@ private func privacyAndSecurityControllerEntries(
670670
entries.append(.lastSeenPrivacy(presentationData.theme, presentationData.strings.PrivacySettings_LastSeen, presentationData.strings.Channel_NotificationLoading))
671671
entries.append(.profilePhotoPrivacy(presentationData.theme, presentationData.strings.Privacy_ProfilePhoto, presentationData.strings.Channel_NotificationLoading))
672672
entries.append(.bioPrivacy(presentationData.theme, presentationData.strings.Privacy_GroupsAndChannels, presentationData.strings.Channel_NotificationLoading))
673-
entries.append(.birthdayPrivacy(presentationData.theme, presentationData.strings.Privacy_Birthday, presentationData.strings.Channel_NotificationLoading))
674673
entries.append(.giftsAutoSavePrivacy(presentationData.theme, presentationData.strings.Privacy_Gifts, presentationData.strings.Channel_NotificationLoading))
674+
entries.append(.birthdayPrivacy(presentationData.theme, presentationData.strings.Privacy_Birthday, presentationData.strings.Channel_NotificationLoading))
675675
entries.append(.forwardPrivacy(presentationData.theme, presentationData.strings.Privacy_Forwards, presentationData.strings.Channel_NotificationLoading))
676676
entries.append(.voiceCallPrivacy(presentationData.theme, presentationData.strings.Privacy_Calls, presentationData.strings.Channel_NotificationLoading))
677677
if !isPremiumDisabled {

submodules/WebUI/Sources/FullscreenControlsComponent.swift

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,34 @@ import LottieAnimationComponent
1212

1313
final class FullscreenControlsComponent: Component {
1414
let context: AccountContext
15+
let strings: PresentationStrings
1516
let title: String
1617
let isVerified: Bool
1718
let insets: UIEdgeInsets
19+
let statusBarStyle: StatusBarStyle
1820
var hasBack: Bool
1921
let backPressed: () -> Void
2022
let minimizePressed: () -> Void
2123
let morePressed: (ASDisplayNode, ContextGesture?) -> Void
2224

2325
init(
2426
context: AccountContext,
27+
strings: PresentationStrings,
2528
title: String,
2629
isVerified: Bool,
2730
insets: UIEdgeInsets,
31+
statusBarStyle: StatusBarStyle,
2832
hasBack: Bool,
2933
backPressed: @escaping () -> Void,
3034
minimizePressed: @escaping () -> Void,
3135
morePressed: @escaping (ASDisplayNode, ContextGesture?) -> Void
3236
) {
3337
self.context = context
38+
self.strings = strings
3439
self.title = title
3540
self.isVerified = isVerified
3641
self.insets = insets
42+
self.statusBarStyle = statusBarStyle
3743
self.hasBack = hasBack
3844
self.backPressed = backPressed
3945
self.minimizePressed = minimizePressed
@@ -53,6 +59,9 @@ final class FullscreenControlsComponent: Component {
5359
if lhs.insets != rhs.insets {
5460
return false
5561
}
62+
if lhs.statusBarStyle != rhs.statusBarStyle {
63+
return false
64+
}
5665
if lhs.hasBack != rhs.hasBack {
5766
return false
5867
}
@@ -161,19 +170,22 @@ final class FullscreenControlsComponent: Component {
161170
let leftBackgroundSize = CGSize(width: 30.0, height: 30.0)
162171
let rightBackgroundSize = CGSize(width: 72.0, height: 30.0)
163172

164-
self.leftBackgroundView.updateColor(color: UIColor(white: 0.67, alpha: 0.35), transition: transition.containedViewLayoutTransition)
165-
self.rightBackgroundView.updateColor(color: UIColor(white: 0.67, alpha: 0.35), transition: transition.containedViewLayoutTransition)
173+
self.leftBackgroundView.updateColor(color: UIColor(white: 0.7, alpha: 0.35), transition: transition.containedViewLayoutTransition)
174+
self.rightBackgroundView.updateColor(color: UIColor(white: 0.7, alpha: 0.35), transition: transition.containedViewLayoutTransition)
166175

167176
let rightBackgroundFrame = CGRect(origin: CGPoint(x: availableSize.width - component.insets.right - sideInset - rightBackgroundSize.width, y: 0.0), size: rightBackgroundSize)
168177
self.rightBackgroundView.update(size: rightBackgroundSize, cornerRadius: rightBackgroundFrame.height / 2.0, transition: transition.containedViewLayoutTransition)
169178
transition.setFrame(view: self.rightBackgroundView, frame: rightBackgroundFrame)
170179

171180
var isAnimatingTextTransition = false
172181

182+
let textColor: UIColor = component.statusBarStyle == .Black ? UIColor(rgb: 0x808080) : .white
183+
self.moreNode.updateColor(textColor, transition: .immediate)
184+
173185
var additionalLeftWidth: CGFloat = 0.0
174186
let titleSize = self.title.update(
175187
transition: .immediate,
176-
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: component.title, font: Font.with(size: 13.0, design: .round, weight: .semibold), textColor: .white)))),
188+
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: component.title, font: Font.with(size: 13.0, design: .round, weight: .semibold), textColor: textColor)))),
177189
environment: {},
178190
containerSize: availableSize
179191
)
@@ -207,7 +219,7 @@ final class FullscreenControlsComponent: Component {
207219

208220
let buttonTitleSize = self.buttonTitle.update(
209221
transition: .immediate,
210-
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: component.hasBack ? "Back" : "Close", font: Font.with(size: 13.0, design: .round, weight: .semibold), textColor: .white)))),
222+
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: component.hasBack ? component.strings.Common_Back : component.strings.Common_Close, font: Font.with(size: 13.0, design: .round, weight: .semibold), textColor: textColor)))),
211223
environment: {},
212224
containerSize: availableSize
213225
)
@@ -233,7 +245,7 @@ final class FullscreenControlsComponent: Component {
233245
if component.isVerified {
234246
let credibilitySize = self.credibility.update(
235247
transition: .immediate,
236-
component: AnyComponent(BundleIconComponent(name: "Instant View/Verified", tintColor: .white)),
248+
component: AnyComponent(BundleIconComponent(name: "Instant View/Verified", tintColor: textColor)),
237249
environment: {},
238250
containerSize: availableSize
239251
)
@@ -284,7 +296,7 @@ final class FullscreenControlsComponent: Component {
284296
mode: .animating(loop: false),
285297
range: component.hasBack ? (0.5, 1.0) : (0.0, 0.5)
286298
),
287-
colors: ["__allcolors__": .white],
299+
colors: ["__allcolors__": textColor],
288300
size: CGSize(width: 30.0, height: 30.0)
289301
)
290302
),
@@ -304,7 +316,7 @@ final class FullscreenControlsComponent: Component {
304316
transition: .immediate,
305317
component: AnyComponent(Button(
306318
content: AnyComponent(
307-
BundleIconComponent(name: "Instant View/MinimizeArrow", tintColor: .white)
319+
BundleIconComponent(name: "Instant View/MinimizeArrow", tintColor: textColor)
308320
),
309321
action: { [weak self] in
310322
guard let self, let component = self.component else {

0 commit comments

Comments
 (0)