@@ -125,7 +125,7 @@ final class LoadingShimmerNode: ASDisplayNode {
125125 private let backgroundColorNode : ASDisplayNode
126126 private let effectNode : SearchShimmerEffectNode
127127 private let maskNode : ASImageNode
128- private var currentParams : ( size: CGSize , theme: PresentationTheme ) ?
128+ private var currentParams : ( size: CGSize , theme: PresentationTheme , showFilters : Bool ) ?
129129
130130 override init ( ) {
131131 self . backgroundColorNode = ASDisplayNode ( )
@@ -142,11 +142,11 @@ final class LoadingShimmerNode: ASDisplayNode {
142142 self . addSubnode ( self . maskNode)
143143 }
144144
145- func update( size: CGSize , theme: PresentationTheme , transition: ContainedViewLayoutTransition ) {
145+ func update( size: CGSize , theme: PresentationTheme , showFilters : Bool , transition: ContainedViewLayoutTransition ) {
146146 let color = theme. list. itemSecondaryTextColor. mixedWith ( theme. list. blocksBackgroundColor, alpha: 0.85 )
147147
148- if self . currentParams? . size != size || self . currentParams? . theme !== theme {
149- self . currentParams = ( size, theme)
148+ if self . currentParams? . size != size || self . currentParams? . theme !== theme || self . currentParams ? . showFilters != showFilters {
149+ self . currentParams = ( size, theme, showFilters )
150150
151151 self . backgroundColorNode. backgroundColor = color
152152
@@ -156,10 +156,12 @@ final class LoadingShimmerNode: ASDisplayNode {
156156
157157 let sideInset : CGFloat = 16.0
158158
159- let filterSpacing : CGFloat = 6.0
160- let filterWidth = ( size. width - sideInset * 2.0 - filterSpacing * 3.0 ) / 4.0
161- for i in 0 ..< 4 {
162- context. addPath ( CGPath ( roundedRect: CGRect ( origin: CGPoint ( x: sideInset + ( filterWidth + filterSpacing) * CGFloat( i) , y: 0.0 ) , size: CGSize ( width: filterWidth, height: 28.0 ) ) , cornerWidth: 14.0 , cornerHeight: 14.0 , transform: nil ) )
159+ if showFilters {
160+ let filterSpacing : CGFloat = 6.0
161+ let filterWidth = ( size. width - sideInset * 2.0 - filterSpacing * 3.0 ) / 4.0
162+ for i in 0 ..< 4 {
163+ context. addPath ( CGPath ( roundedRect: CGRect ( origin: CGPoint ( x: sideInset + ( filterWidth + filterSpacing) * CGFloat( i) , y: 0.0 ) , size: CGSize ( width: filterWidth, height: 28.0 ) ) , cornerWidth: 14.0 , cornerHeight: 14.0 , transform: nil ) )
164+ }
163165 }
164166
165167 var currentY : CGFloat = 39.0 + 7.0
0 commit comments