Introduce HorizontalButtonsContainerView

This commit is contained in:
ismailgulek
2021-03-12 03:40:55 +03:00
parent 409206e8d2
commit 0483f26040
2 changed files with 110 additions and 0 deletions
@@ -0,0 +1,41 @@
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import UIKit
import Reusable
class HorizontalButtonsContainerView: UIStackView {
@IBOutlet weak var firstButton: CallTileActionButton!
@IBOutlet weak var secondButton: CallTileActionButton!
required init(coder: NSCoder) {
super.init(coder: coder)
translatesAutoresizingMaskIntoConstraints = false
}
}
extension HorizontalButtonsContainerView: NibLoadable {}
extension HorizontalButtonsContainerView: Themable {
func update(theme: Theme) {
firstButton.update(theme: theme)
secondButton.update(theme: theme)
}
}
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<stackView verifyAmbiguity="ignoreSizes" opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="UVD-pT-koz" customClass="HorizontalButtonsContainerView" customModule="Riot" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="78"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8md-Jx-SGt">
<rect key="frame" x="0.0" y="14" width="1" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="kRw-vR-jdf"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Qjq-AW-dwM" customClass="CallTileActionButton" customModule="Riot" customModuleProvider="target">
<rect key="frame" x="84" y="16" width="108" height="46"/>
<color key="backgroundColor" systemColor="systemRedColor"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="contentEdgeInsets" minX="12" minY="8" maxX="12" maxY="8"/>
<state key="normal" title="Decline" image="voice_call_hangup_icon"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="u30-NE-ETc" customClass="CallTileActionButton" customModule="Riot" customModuleProvider="target">
<rect key="frame" x="226" y="16" width="100" height="46"/>
<color key="backgroundColor" systemColor="systemGreenColor"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="contentEdgeInsets" minX="12" minY="8" maxX="12" maxY="8"/>
<state key="normal" title="Answer" image="call_video_icon"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vjR-lf-Sa1">
<rect key="frame" x="413" y="14" width="1" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="1Ki-pw-EhH"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="u30-NE-ETc" secondAttribute="bottom" constant="16" id="KVZ-FW-iuZ"/>
<constraint firstAttribute="bottom" secondItem="Qjq-AW-dwM" secondAttribute="bottom" constant="16" id="OwF-CE-LOh"/>
<constraint firstItem="u30-NE-ETc" firstAttribute="top" secondItem="UVD-pT-koz" secondAttribute="top" constant="16" id="kWK-Q6-JMU"/>
<constraint firstItem="Qjq-AW-dwM" firstAttribute="top" secondItem="UVD-pT-koz" secondAttribute="top" constant="16" id="lwK-yD-oPs"/>
</constraints>
<connections>
<outlet property="firstButton" destination="Qjq-AW-dwM" id="FhF-HD-Tht"/>
<outlet property="secondButton" destination="u30-NE-ETc" id="OQP-60-iGS"/>
</connections>
<point key="canvasLocation" x="-453" y="81"/>
</stackView>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
</objects>
<resources>
<image name="call_video_icon" width="16" height="16"/>
<image name="voice_call_hangup_icon" width="24" height="24"/>
<systemColor name="systemGreenColor">
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemRedColor">
<color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>