Commit 09dd270d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

UI: call buttons

Keep cancel button in the middle

Change-Id: I80202d386e607464c8cb0762aa4f5a94ac9d1106
parent ad2a648b
...@@ -35,13 +35,10 @@ class ButtonsContainerView: UIView, NibLoadable { ...@@ -35,13 +35,10 @@ class ButtonsContainerView: UIView, NibLoadable {
@IBOutlet weak var dialpadButton: UIButton! @IBOutlet weak var dialpadButton: UIButton!
@IBOutlet weak var switchSpeakerButton: UIButton! @IBOutlet weak var switchSpeakerButton: UIButton!
@IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var cancelButton: UIButton!
//@IBOutlet weak var spaceButton: UIButton!
@IBOutlet weak var switchCameraButton: UIButton! @IBOutlet weak var switchCameraButton: UIButton!
//Constraints //Constraints
@IBOutlet weak var cancelButtonWidthConstraint: NSLayoutConstraint! @IBOutlet weak var cancelButtonWidthConstraint: NSLayoutConstraint!
@IBOutlet weak var cancelButtonCenterConstraint: NSLayoutConstraint!
@IBOutlet weak var cancelButtonRightAlligmentConstraint: NSLayoutConstraint!
@IBOutlet weak var cancelButtonBottomConstraint: NSLayoutConstraint! @IBOutlet weak var cancelButtonBottomConstraint: NSLayoutConstraint!
@IBOutlet weak var cancelButtonHeightConstraint: NSLayoutConstraint! @IBOutlet weak var cancelButtonHeightConstraint: NSLayoutConstraint!
@IBOutlet weak var stackViewYConstraint: NSLayoutConstraint! @IBOutlet weak var stackViewYConstraint: NSLayoutConstraint!
...@@ -100,8 +97,6 @@ class ButtonsContainerView: UIView, NibLoadable { ...@@ -100,8 +97,6 @@ class ButtonsContainerView: UIView, NibLoadable {
switchSpeakerButton.isHidden = true switchSpeakerButton.isHidden = true
cancelButton.isHidden = false cancelButton.isHidden = false
cancelButtonBottomConstraint.constant = 20 cancelButtonBottomConstraint.constant = 20
cancelButtonRightAlligmentConstraint.priority = UILayoutPriority(rawValue: 250.0)
cancelButtonCenterConstraint.priority = UILayoutPriority(rawValue: 999.0)
} }
func optionsWithSpeaker() { func optionsWithSpeaker() {
...@@ -116,14 +111,10 @@ class ButtonsContainerView: UIView, NibLoadable { ...@@ -116,14 +111,10 @@ class ButtonsContainerView: UIView, NibLoadable {
dialpadButton.isHidden = false dialpadButton.isHidden = false
} }
cancelButtonBottomConstraint.constant = 20 cancelButtonBottomConstraint.constant = 20
cancelButtonRightAlligmentConstraint.priority = UILayoutPriority(rawValue: 250.0)
cancelButtonCenterConstraint.priority = UILayoutPriority(rawValue: 999.0)
} else { } else {
muteVideoButton.isHidden = false muteVideoButton.isHidden = false
switchCameraButton.isHidden = false switchCameraButton.isHidden = false
cancelButtonBottomConstraint.constant = 120 cancelButtonBottomConstraint.constant = 120
cancelButtonCenterConstraint.priority = UILayoutPriority(rawValue: 250.0)
cancelButtonRightAlligmentConstraint.priority = UILayoutPriority(rawValue: 999.0)
} }
pauseCallButton.isHidden = false pauseCallButton.isHidden = false
switchSpeakerButton.isEnabled = true switchSpeakerButton.isEnabled = true
...@@ -142,14 +133,10 @@ class ButtonsContainerView: UIView, NibLoadable { ...@@ -142,14 +133,10 @@ class ButtonsContainerView: UIView, NibLoadable {
dialpadButton.isHidden = false dialpadButton.isHidden = false
} }
cancelButtonBottomConstraint.constant = 20 cancelButtonBottomConstraint.constant = 20
cancelButtonRightAlligmentConstraint.priority = UILayoutPriority(rawValue: 250.0)
cancelButtonCenterConstraint.priority = UILayoutPriority(rawValue: 999.0)
} else { } else {
switchCameraButton.isHidden = false switchCameraButton.isHidden = false
muteVideoButton.isHidden = false muteVideoButton.isHidden = false
cancelButtonBottomConstraint.constant = 120 cancelButtonBottomConstraint.constant = 120
cancelButtonCenterConstraint.priority = UILayoutPriority(rawValue: 250.0)
cancelButtonRightAlligmentConstraint.priority = UILayoutPriority(rawValue: 999.0)
} }
switchSpeakerButton.isEnabled = false switchSpeakerButton.isEnabled = false
self.muteAudioButton.isHidden = false self.muteAudioButton.isHidden = false
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
<outlet property="backgroundBlurEffect" destination="w5l-pw-1ET" id="YYh-qB-WIL"/> <outlet property="backgroundBlurEffect" destination="w5l-pw-1ET" id="YYh-qB-WIL"/>
<outlet property="cancelButton" destination="ZxT-mA-1xU" id="4nk-iI-vPV"/> <outlet property="cancelButton" destination="ZxT-mA-1xU" id="4nk-iI-vPV"/>
<outlet property="cancelButtonBottomConstraint" destination="Ilu-Zu-JqW" id="Yeg-Ca-8pf"/> <outlet property="cancelButtonBottomConstraint" destination="Ilu-Zu-JqW" id="Yeg-Ca-8pf"/>
<outlet property="cancelButtonCenterConstraint" destination="ls1-Ze-LXF" id="C7A-Xr-QqX"/>
<outlet property="cancelButtonHeightConstraint" destination="kls-aA-2zS" id="CzE-vC-V5Z"/> <outlet property="cancelButtonHeightConstraint" destination="kls-aA-2zS" id="CzE-vC-V5Z"/>
<outlet property="cancelButtonRightAlligmentConstraint" destination="E6D-cY-KlH" id="6nx-eq-uuw"/>
<outlet property="cancelButtonWidthConstraint" destination="0vV-4C-odp" id="beL-yR-ehA"/> <outlet property="cancelButtonWidthConstraint" destination="0vV-4C-odp" id="beL-yR-ehA"/>
<outlet property="container" destination="a9g-pf-bHy" id="6bw-CB-5qN"/> <outlet property="container" destination="a9g-pf-bHy" id="6bw-CB-5qN"/>
<outlet property="containerHeightConstraint" destination="Gjk-7U-rEe" id="G5G-Uh-zRV"/> <outlet property="containerHeightConstraint" destination="Gjk-7U-rEe" id="G5G-Uh-zRV"/>
...@@ -195,7 +193,7 @@ ...@@ -195,7 +193,7 @@
</constraints> </constraints>
</stackView> </stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZxT-mA-1xU"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZxT-mA-1xU">
<rect key="frame" x="290" y="10" width="70" height="70"/> <rect key="frame" x="152.5" y="10" width="70" height="70"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="70" id="0vV-4C-odp"/> <constraint firstAttribute="width" constant="70" id="0vV-4C-odp"/>
<constraint firstAttribute="height" constant="70" id="kls-aA-2zS"/> <constraint firstAttribute="height" constant="70" id="kls-aA-2zS"/>
...@@ -218,7 +216,6 @@ ...@@ -218,7 +216,6 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="bottom" secondItem="w5l-pw-1ET" secondAttribute="bottom" id="6qu-Nn-b1Y"/> <constraint firstAttribute="bottom" secondItem="w5l-pw-1ET" secondAttribute="bottom" id="6qu-Nn-b1Y"/>
<constraint firstItem="ZxT-mA-1xU" firstAttribute="trailing" secondItem="RHx-cL-CV5" secondAttribute="trailing" priority="999" id="E6D-cY-KlH"/>
<constraint firstAttribute="height" constant="200" id="Gjk-7U-rEe"/> <constraint firstAttribute="height" constant="200" id="Gjk-7U-rEe"/>
<constraint firstAttribute="bottom" secondItem="ZxT-mA-1xU" secondAttribute="bottom" constant="120" id="Ilu-Zu-JqW"/> <constraint firstAttribute="bottom" secondItem="ZxT-mA-1xU" secondAttribute="bottom" constant="120" id="Ilu-Zu-JqW"/>
<constraint firstAttribute="trailing" secondItem="w5l-pw-1ET" secondAttribute="trailing" id="TnQ-lp-9B9"/> <constraint firstAttribute="trailing" secondItem="w5l-pw-1ET" secondAttribute="trailing" id="TnQ-lp-9B9"/>
...@@ -226,7 +223,7 @@ ...@@ -226,7 +223,7 @@
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="450" id="ZfR-cx-MUB"/> <constraint firstAttribute="width" relation="lessThanOrEqual" constant="450" id="ZfR-cx-MUB"/>
<constraint firstItem="w5l-pw-1ET" firstAttribute="leading" secondItem="a9g-pf-bHy" secondAttribute="leading" id="bbd-5D-5So"/> <constraint firstItem="w5l-pw-1ET" firstAttribute="leading" secondItem="a9g-pf-bHy" secondAttribute="leading" id="bbd-5D-5So"/>
<constraint firstItem="RHx-cL-CV5" firstAttribute="centerX" secondItem="a9g-pf-bHy" secondAttribute="centerX" id="bmE-qo-8aJ"/> <constraint firstItem="RHx-cL-CV5" firstAttribute="centerX" secondItem="a9g-pf-bHy" secondAttribute="centerX" id="bmE-qo-8aJ"/>
<constraint firstItem="ZxT-mA-1xU" firstAttribute="centerX" secondItem="a9g-pf-bHy" secondAttribute="centerX" priority="250" id="ls1-Ze-LXF"/> <constraint firstItem="ZxT-mA-1xU" firstAttribute="centerX" secondItem="a9g-pf-bHy" secondAttribute="centerX" id="ls1-Ze-LXF"/>
<constraint firstAttribute="trailing" secondItem="RHx-cL-CV5" secondAttribute="trailing" constant="15" id="pgj-7m-5gr"/> <constraint firstAttribute="trailing" secondItem="RHx-cL-CV5" secondAttribute="trailing" constant="15" id="pgj-7m-5gr"/>
<constraint firstAttribute="bottom" secondItem="RHx-cL-CV5" secondAttribute="bottom" constant="30" id="z8B-uv-Vcb"/> <constraint firstAttribute="bottom" secondItem="RHx-cL-CV5" secondAttribute="bottom" constant="30" id="z8B-uv-Vcb"/>
</constraints> </constraints>
......
...@@ -598,7 +598,7 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased { ...@@ -598,7 +598,7 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased {
UIView.animate(withDuration: 0.2, animations: { [unowned self] in UIView.animate(withDuration: 0.2, animations: { [unowned self] in
self.resizeCapturedVideo(withInfoContainer: false) self.resizeCapturedVideo(withInfoContainer: false)
self.infoContainerTopConstraint.constant = 150 self.infoContainerTopConstraint.constant = 150
self.buttonsContainerBottomConstraint.constant = -150 self.buttonsContainerBottomConstraint.constant = -200
self.view.layoutIfNeeded() self.view.layoutIfNeeded()
}, completion: { [weak self] _ in }, completion: { [weak self] _ in
self?.infoContainer.isHidden = true self?.infoContainer.isHidden = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment