Add more space to call view in landscape mode

This commit is contained in:
Christophe Deschamps 2022-08-24 09:34:20 +02:00
parent 1e886125b9
commit a6b7182bd0
3 changed files with 15 additions and 1 deletions

View file

@ -254,10 +254,21 @@ extension UIView {
return self
}
func updateAlignParentBottom(withMargin:CGFloat = 0.0) -> UIView {
snp.updateConstraints { (make) in
make.bottom.equalToSuperview().offset(-withMargin)
}
return self
}
func alignParentBottom(withMargin:Int) -> UIView {
return alignParentBottom(withMargin:CGFloat(withMargin))
}
func updateAlignParentBottom(withMargin:Int) -> UIView {
return updateAlignParentBottom(withMargin:CGFloat(withMargin))
}
func alignAbove(view:UIView, withMargin:CGFloat = 0.0) -> UIView {
snp.makeConstraints { (make) in
make.bottom.equalTo(view.snp.top).offset(-withMargin)

View file

@ -402,6 +402,7 @@ import linphonesw
let leftMargin = UIDevice.current.orientation == .landscapeLeft && UIDevice.hasNotch() ? UIApplication.shared.keyWindow!.safeAreaInsets.left : ActiveCallOrConferenceView.content_inset
let rightMargin = UIDevice.current.orientation == .landscapeRight && UIDevice.hasNotch() ? UIApplication.shared.keyWindow!.safeAreaInsets.right : ActiveCallOrConferenceView.content_inset
fullScreenMutableContainerView.updateAlignParentLeft(withMargin: leftMargin).updateAlignParentRight(withMargin: rightMargin).done()
controlsView.updateAlignParentBottom(withMargin:SharedLayoutConstants.buttons_bottom_margin).centerX().done()
}
override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {

View file

@ -21,7 +21,9 @@
import Foundation
class SharedLayoutConstants {
static let buttons_bottom_margin = UIDevice.hasNotch() ? 30 : 15
static var buttons_bottom_margin : Int {
get { UIDevice.hasNotch() && UIDevice.current.orientation == .portrait ? 30 : 15 }
}
static let margin_call_view_side_controls_buttons = 12
static let bottom_margin_notch_clearance = UIDevice.hasNotch() ? 30.0 : 0.0