@@ -12,28 +12,34 @@ import LottieAnimationComponent
1212
1313final 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