Skip to content

Commit eab29de

Browse files
elaine-signalmarissa-signal
authored andcommitted
Fix layout issues with group call drawer
1 parent 593f5c6 commit eab29de

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Signal/Calls/UserInterface/CallDrawerSheet.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ class CallDrawerSheet: InteractiveSheetViewController {
364364
override func heightDidChange(to height: InteractiveSheetViewController.SheetHeight) {
365365
switch height {
366366
case .min:
367+
guard UIView.inheritedAnimationDuration > 0 else {
368+
changesForSnapToMin()
369+
break
370+
}
371+
367372
let currentHeight = switch lastKnownHeight {
368373
case .min:
369374
self.minimizedHeight
@@ -433,6 +438,11 @@ class CallDrawerSheet: InteractiveSheetViewController {
433438
changesForSnapToMax()
434439
}
435440
case .max:
441+
guard UIView.inheritedAnimationDuration > 0 else {
442+
changesForSnapToMax()
443+
break
444+
}
445+
436446
let currentHeight = switch lastKnownHeight {
437447
case .min:
438448
self.minimizedHeight
@@ -584,7 +594,7 @@ extension CallDrawerSheet {
584594
}
585595

586596
func isPresentingCallInfo() -> Bool {
587-
return self.presentingViewController != nil && tableView.alpha == 1
597+
return self.presentingViewController != nil && tableViewContainer.alpha == 1
588598
}
589599

590600
func isCrossFading() -> Bool {

Signal/Calls/UserInterface/GroupCallViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ class GroupCallViewController: UIViewController {
810810
if shouldRepositionBottomVStack {
811811
switch bottomSheetStateManager.bottomSheetState {
812812
case .callControlsAndOverflow, .callControls, .callInfo, .transitioning:
813-
yMax = size.height - bottomSheet.sheetHeight - 16
813+
yMax = size.height - bottomSheet.minimizedHeight - 16
814814
case .hidden:
815815
yMax = size.height - 32
816816
}
@@ -1015,11 +1015,11 @@ class GroupCallViewController: UIViewController {
10151015
}
10161016

10171017
private var callControlsOverflowBottomConstraintConstant: CGFloat {
1018-
-self.bottomSheet.sheetHeight - 12
1018+
-self.bottomSheet.minimizedHeight - 12
10191019
}
10201020

10211021
private var callControlsConfirmationToastContainerViewBottomConstraintConstant: CGFloat {
1022-
return -self.bottomSheet.sheetHeight - 16
1022+
return -self.bottomSheet.minimizedHeight - 16
10231023
}
10241024

10251025
private func callControlDisplayStateDidChange(

Signal/Calls/UserInterface/IndividualCallViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class IndividualCallViewController: OWSViewController, IndividualCallObserver {
340340

341341
private var callControlsConfirmationToastContainerViewBottomConstraint: NSLayoutConstraint?
342342
private var callControlsConfirmationToastContainerViewBottomConstraintConstant: CGFloat {
343-
return -self.bottomSheet.sheetHeight - 16
343+
return -self.bottomSheet.minimizedHeight - 16
344344
}
345345

346346
private func presentBottomSheet(_ animated: Bool) {

SignalUI/ViewControllers/InteractiveSheetViewController.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ open class InteractiveSheetViewController: OWSViewController {
4242
return (sheetContainerView as? UIVisualEffectView)?.contentView ?? sheetContainerView
4343
}
4444

45-
// Do yourself a favor and do not expose the sheet view and try to
46-
// constrain to it from another ViewController, even if said
47-
// ViewController is presenting this one.
48-
public var sheetHeight: CGFloat {
49-
let sheet = (sheetContainerView as? UIVisualEffectView)?.contentView ?? sheetContainerView
50-
return sheet.height
51-
}
52-
5345
private let sheetStackView: UIStackView = {
5446
let view = UIStackView()
5547
view.axis = .vertical

0 commit comments

Comments
 (0)