@@ -94,20 +94,16 @@ open class ActionSheetController: OWSViewController {
9494 }
9595 action. button. applyActionSheetTheme ( theme)
9696
97- let hairline = UIView ( )
98- hairline. backgroundColor = theme. hairlineColor
99- hairline. autoSetDimension ( . height, toSize: 1 )
100-
10197 // If we've already added a cancel action, any non-cancel actions should come before it
10298 // This matches how UIAlertController handles cancel actions.
10399 if action. style != . cancel,
104100 let firstCancelAction = firstCancelAction,
105101 let index = stackView. arrangedSubviews. firstIndex ( of: firstCancelAction. button) {
106102 // The hairline we're inserting is the divider between the new button and the cancel button
107- stackView. insertArrangedSubview ( hairline , at: index)
103+ stackView. insertHairline ( with : theme . hairlineColor , at: index)
108104 stackView. insertArrangedSubview ( action. button, at: index)
109105 } else {
110- stackView. addArrangedSubview ( hairline )
106+ stackView. addHairline ( with : theme . hairlineColor )
111107 stackView. addArrangedSubview ( action. button)
112108 }
113109 action. button. contentAlignment = contentAlignment
@@ -172,11 +168,11 @@ open class ActionSheetController: OWSViewController {
172168 //
173169 // This means that the backdrop view will extend outside of the bounds of the content view as the user
174170 // scrolls the content out of the safe area
175- let backdropView = theme. createBackdropView ( )
176- contentView. addSubview ( backdropView )
177- backdropView . autoPinWidthToSuperview ( )
178- backdropView . autoPinEdge ( . top, to: . top, of: contentView)
179- scrollView. frameLayoutGuide. bottomAnchor. constraint ( equalTo: backdropView . bottomAnchor) . isActive = true
171+ let backgroundView = theme. createBackgroundView ( )
172+ contentView. addSubview ( backgroundView )
173+ backgroundView . autoPinWidthToSuperview ( )
174+ backgroundView . autoPinEdge ( . top, to: . top, of: contentView)
175+ scrollView. frameLayoutGuide. bottomAnchor. constraint ( equalTo: backgroundView . bottomAnchor) . isActive = true
180176
181177 // Stack views don't support corner masking pre-iOS 14
182178 // Instead we add our stack view to a wrapper view with masksToBounds: true
@@ -192,7 +188,7 @@ open class ActionSheetController: OWSViewController {
192188 // view's bounds. But its two subviews are pinned at same top edge. We can just apply corner
193189 // radii to each layer individually to get a similar effect.
194190 let cornerRadius : CGFloat = 16
195- [ backdropView , stackViewContainer] . forEach { subview in
191+ [ backgroundView , stackViewContainer] . forEach { subview in
196192 subview. layer. cornerRadius = cornerRadius
197193 subview. layer. maskedCorners = [ . layerMinXMinYCorner, . layerMaxXMinYCorner]
198194 subview. layer. masksToBounds = true
@@ -465,7 +461,7 @@ public class ActionSheetAction: NSObject {
465461 fatalError ( " init(coder:) has not been implemented " )
466462 }
467463
468- func applyActionSheetTheme( _ theme: Theme . ActionSheet ) {
464+ public func applyActionSheetTheme( _ theme: Theme . ActionSheet ) {
469465 // Recolor everything based on the requested theme
470466 setBackgroundImage ( UIImage ( color: theme. buttonHighlightColor) , for: . highlighted)
471467
0 commit comments