factorize chat room creations

This commit is contained in:
Benjamin Reis 2017-12-01 11:47:04 +01:00
parent 8eaa148918
commit 63f6920541
14 changed files with 161 additions and 172 deletions

View file

@ -19,7 +19,6 @@
<outlet property="selectedButtonImage" destination="ibu-Ra-oZO" id="jvl-ay-cfh"/>
<outlet property="tableController" destination="4" id="18"/>
<outlet property="view" destination="5" id="14"/>
<outlet property="waitView" destination="CwL-Gm-5EH" id="Zte-9n-SFk"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@ -145,18 +144,6 @@
<outlet property="delegate" destination="4" id="MJr-oP-Hib"/>
</connections>
</searchBar>
<view hidden="YES" tag="8" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CwL-Gm-5EH" userLabel="waitView">
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<activityIndicatorView opaque="NO" tag="9" contentMode="scaleToFill" fixedFrame="YES" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="YYS-fL-sfZ" userLabel="activityIndicatorView">
<rect key="frame" x="179" y="267" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<gestureRecognizers/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>

View file

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HistoryDetailsView">
@ -80,7 +84,7 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView hidden="YES" userInteractionEnabled="NO" tag="10" contentMode="scaleAspectFit" image="linphone_user.png" id="mfN-Ai-9RX" userLabel="linphoneImage" customClass="UIRoundedImageView">
@ -96,14 +100,14 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.98766469955444336" green="0.27512490749359131" blue="0.029739789664745331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="12" contentMode="scaleAspectFit" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="obZ-W7-q8P" userLabel="chatButton">
<rect key="frame" x="202" y="189" width="51" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="chat_start_body_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="disabled" image="chat_start_body_disabled.png"/>
<state key="highlighted" image="chat_start_body_over.png"/>
@ -115,7 +119,7 @@
<rect key="frame" x="122" y="189" width="51" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="call_start_body_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="disabled" image="call_start_body_disabled.png"/>
<state key="highlighted" image="call_start_body_over.png"/>
@ -124,12 +128,12 @@
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<tableView clipsSubviews="YES" tag="6" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" allowsSelection="NO" rowHeight="30" sectionHeaderHeight="28" sectionFooterHeight="28" id="k6N-Av-eOu">
<rect key="frame" x="0.0" y="316" width="375" height="243"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="dataSource" destination="baU-d4-eu3" id="p7o-Mx-Kmc"/>
<outlet property="delegate" destination="baU-d4-eu3" id="iS5-xg-0C2"/>
@ -138,37 +142,36 @@
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" tag="40" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No log selected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hvz-CS-NME" userLabel="emptyLabel">
<rect key="frame" x="0.0" y="66" width="375" height="493"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<point key="canvasLocation" x="254.5" y="288.5"/>
</view>
<view contentMode="scaleToFill" id="LBc-mh-ozk" userLabel="iphone6MetricsView">
<rect key="frame" x="0.0" y="0.0" width="667" height="375"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view tag="1" contentMode="scaleToFill" id="NHC-7w-48z">
<rect key="frame" x="0.0" y="42" width="667" height="333"/>
<rect key="frame" x="0.0" y="42" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view tag="2" contentMode="scaleToFill" id="Rtv-hu-bCz" userLabel="topBar">
<rect key="frame" x="0.0" y="0.0" width="667" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="3" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="JOe-5t-C7f" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="667" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
</imageView>
<button opaque="NO" tag="4" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="NJl-Lb-CU6" userLabel="backButton" customClass="UIIconButton">
<rect key="frame" x="0.0" y="0.0" width="72" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="40" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Back"/>
<inset key="titleEdgeInsets" minX="0.0" minY="18" maxX="0.0" maxY="0.0"/>
@ -180,7 +183,7 @@
</connections>
</button>
<button opaque="NO" tag="5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="O7r-6t-b7w" userLabel="addButton" customClass="UIIconButton">
<rect key="frame" x="595" y="0.0" width="72" height="66"/>
<rect key="frame" x="334" y="0.0" width="41" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Add to contact"/>
<inset key="titleEdgeInsets" minX="0.0" minY="18" maxX="0.0" maxY="0.0"/>
@ -194,20 +197,20 @@
</subviews>
</view>
<tableView clipsSubviews="YES" tag="6" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" allowsSelection="NO" rowHeight="30" sectionHeaderHeight="44" sectionFooterHeight="22" id="2jK-gw-ULv">
<rect key="frame" x="0.0" y="168" width="667" height="165"/>
<rect key="frame" x="0.0" y="168" width="375" height="457"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="dataSource" destination="baU-d4-eu3" id="fI9-T2-u1D"/>
<outlet property="delegate" destination="baU-d4-eu3" id="xk6-7r-gBl"/>
</connections>
</tableView>
<view tag="7" contentMode="scaleToFill" id="Mwp-y3-g1b" userLabel="headerView">
<rect key="frame" x="0.0" y="66" width="667" height="102"/>
<rect key="frame" x="0.0" y="66" width="375" height="102"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" tag="8" contentMode="scaleAspectFit" image="avatar.png" id="d9m-G0-1u3" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="30" y="8" width="86" height="86"/>
<rect key="frame" x="16" y="8" width="49" height="86"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact avatar">
<accessibilityTraits key="traits" image="YES" notEnabled="YES"/>
@ -215,26 +218,26 @@
</accessibility>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="9" contentMode="left" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="17" id="Qbg-hm-bd7" userLabel="contactLabel">
<rect key="frame" x="161" y="8" width="356" height="50"/>
<rect key="frame" x="90" y="8" width="200" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="33"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="11" contentMode="left" text="johndoe@sip.linphone.org" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="XJa-f6-K0y" userLabel="addressLabel">
<rect key="frame" x="161" y="56" width="356" height="38"/>
<rect key="frame" x="90" y="56" width="200" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="textColor" red="0.98766469955444336" green="0.27512490749359131" blue="0.029739789664745331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" tag="12" contentMode="scaleAspectFit" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="MRH-yi-acw" userLabel="chatButton">
<rect key="frame" x="608" y="25" width="51" height="51"/>
<rect key="frame" x="319" y="25" width="51" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="chat_start_body_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="disabled" image="chat_start_body_disabled.png"/>
<state key="highlighted" image="chat_start_body_over.png"/>
@ -243,10 +246,10 @@
</connections>
</button>
<button opaque="NO" tag="13" contentMode="scaleAspectFit" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="zZo-Pc-EVi" userLabel="callButton">
<rect key="frame" x="525" y="25" width="51" height="51"/>
<rect key="frame" x="276" y="25" width="51" height="51"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="call_start_body_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="disabled" image="call_start_body_disabled.png"/>
<state key="highlighted" image="call_start_body_over.png"/>
@ -255,7 +258,7 @@
</connections>
</button>
<imageView hidden="YES" userInteractionEnabled="NO" tag="10" contentMode="scaleAspectFit" image="linphone_user.png" id="G2O-Yh-fZA" userLabel="linphoneImage">
<rect key="frame" x="124" y="8" width="29" height="25"/>
<rect key="frame" x="69" y="8" width="17" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Contact avatar">
<accessibilityTraits key="traits" image="YES" notEnabled="YES"/>
@ -263,23 +266,21 @@
</accessibility>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" tag="40" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No log selected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="IHY-Yg-pkN" userLabel="emptyLabel">
<rect key="frame" x="0.0" y="66" width="667" height="267"/>
<rect key="frame" x="0.0" y="66" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<point key="canvasLocation" x="348.5" y="-44.5"/>
</view>
<tableViewController id="baU-d4-eu3" customClass="HistoryDetailsTableView">
@ -290,9 +291,9 @@
</tableViewController>
</objects>
<resources>
<image name="avatar.png" width="255" height="255"/>
<image name="back_default.png" width="24" height="21"/>
<image name="back_disabled.png" width="24" height="21"/>
<image name="avatar.png" width="259" height="259"/>
<image name="back_default.png" width="24" height="22"/>
<image name="back_disabled.png" width="24" height="22"/>
<image name="call_start_body_default.png" width="51" height="51"/>
<image name="call_start_body_disabled.png" width="51" height="51"/>
<image name="call_start_body_over.png" width="51" height="51"/>

View file

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PhoneMainView">
@ -10,6 +14,7 @@
<outlet property="mainViewController" destination="208" id="209"/>
<outlet property="statusBarBG" destination="6sv-JD-j8Z" id="CCl-1v-2B7"/>
<outlet property="view" destination="152" id="WV3-Jd-QMD"/>
<outlet property="waitView" destination="Dvq-5A-rj8" id="0lc-Bg-lab"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@ -24,23 +29,31 @@
<view tag="1" contentMode="scaleToFill" id="avX-6g-QDq" userLabel="background">
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<view contentMode="scaleToFill" id="6sv-JD-j8Z" userLabel="statusBarBG">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<view hidden="YES" tag="8" contentMode="scaleToFill" misplaced="YES" id="Dvq-5A-rj8" userLabel="waitView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<activityIndicatorView opaque="NO" tag="9" contentMode="scaleToFill" animating="YES" style="gray" id="Ptd-XU-wcF" userLabel="activityIndicatorView">
<rect key="frame" x="179" y="321" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<gestureRecognizers/>
</view>
</subviews>
<animations/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<point key="canvasLocation" x="32.5" y="86.5"/>
</view>
<viewController nibName="UICompositeView" wantsFullScreenLayout="YES" id="208" userLabel="mainViewController" customClass="UICompositeView">
<extendedEdge key="edgesForExtendedLayout"/>

View file

@ -24,7 +24,6 @@
@property (weak, nonatomic) IBOutlet UIIconButton *allButton;
@property (weak, nonatomic) IBOutlet UIIconButton *linphoneButton;
@property (weak, nonatomic) IBOutlet UIImageView *selectedButtonImage;
@property (weak, nonatomic) IBOutlet UIView *waitView;
@property(nonatomic) Boolean isForEditing;

View file

@ -58,7 +58,6 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_waitView.hidden = YES;
if(_tableController.contactsGroup.count == 0) {
if (!_isForEditing)
_nextButton.enabled = FALSE;
@ -76,40 +75,11 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Chat room functions
void create_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) {
ChatConversationCreateView *view = (__bridge ChatConversationCreateView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_callbacks(cr));
switch (newState) {
case LinphoneChatRoomStateCreated:
LOGI(@"Chat room [%p] created on server.", cr);
[view onChatRoomCreated:cr];
break;
case LinphoneChatRoomStateCreationFailed:
view.waitView.hidden = YES;
[ChatConversationInfoView displayCreationError];
LOGE(@"Chat room [%p] could not be created on server.", cr);
break;
default:
break;
}
}
- (void)onChatRoomCreated:(LinphoneChatRoom *)cr {
ChatConversationView *view = VIEW(ChatConversationView);
_waitView.hidden = YES;
view.chatRoom = cr;
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
- (void)createChatRoom {
_waitView.hidden = NO;
LinphoneChatRoom *room = linphone_core_create_client_group_chat_room(LC, LINPHONE_DUMMY_SUBJECT);
NSString *addr = _tableController.contactsGroup[0];
LinphoneAddress *linphoneAddress = linphone_address_new(addr.UTF8String);
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(room);
linphone_chat_room_cbs_set_state_changed(cbs, create_chat_room_state_changed);
linphone_chat_room_cbs_set_user_data(cbs, (__bridge void*)self);
bctbx_list_t *addresses = bctbx_list_new((void *)linphoneAddress);
linphone_chat_room_add_participants(room, addresses);
[PhoneMainView.instance createChatRoomWithSubject:LINPHONE_DUMMY_SUBJECT andAddresses:addresses];
bctbx_list_free_with_data(addresses, (void (*)(void *))linphone_address_unref);
}

View file

@ -27,7 +27,6 @@
@property (weak, nonatomic) IBOutlet UIIconButton *addButton;
@property (weak, nonatomic) IBOutlet UITextField *nameLabel;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIView *waitView;
+ (void)displayCreationError;

View file

@ -74,7 +74,6 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_waitView.hidden = YES;
_nameLabel.text = _room && linphone_chat_room_get_subject(_room)
? [NSString stringWithUTF8String:linphone_chat_room_get_subject(_room)]
: @"";
@ -102,7 +101,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if (_room) {
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(_room);
linphone_chat_room_cbs_set_state_changed(cbs, chat_room_state_changed);
linphone_chat_room_cbs_set_state_changed(cbs, main_view_chat_room_state_changed);
linphone_chat_room_cbs_set_subject_changed(cbs, chat_room_subject_changed);
linphone_chat_room_cbs_set_participant_added(cbs, chat_room_participant_added);
linphone_chat_room_cbs_set_participant_removed(cbs, chat_room_participant_removed);
@ -116,14 +115,6 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - next functions
- (void)onCreate {
_waitView.hidden = NO;
LinphoneChatRoom *room = linphone_core_create_client_group_chat_room(LC, _nameLabel.text.UTF8String);
if(!room) {
return;
}
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(room);
linphone_chat_room_cbs_set_state_changed(cbs, chat_room_state_changed);
linphone_chat_room_cbs_set_user_data(cbs, (__bridge void*)self);
bctbx_list_t *addresses = NULL;
for(NSString *addr in _contacts) {
LinphoneAddress *linphoneAddress = linphone_address_new(addr.UTF8String);
@ -136,7 +127,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
addresses = bctbx_list_append(addresses, (void *)linphoneAddress);
}
linphone_chat_room_add_participants(room, addresses);
[PhoneMainView.instance createChatRoomWithSubject:_nameLabel.text.UTF8String andAddresses:addresses];
bctbx_list_free_with_data(addresses, (void (*)(void *))linphone_address_unref);
}
@ -302,13 +293,6 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - chat room callbacks
- (void)goToChatRoom:(LinphoneChatRoom *)cr {
_waitView.hidden = YES;
ChatConversationView *view = VIEW(ChatConversationView);
view.chatRoom = cr;
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
- (void)myAdminStatusChanged:(BOOL)admin {
NSString *message = admin
? NSLocalizedString(@"You are now an admin of the chat room", nil)
@ -328,27 +312,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[PhoneMainView.instance presentViewController:alertView animated:YES completion:nil];
}
void chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) {
ChatConversationInfoView *view = (__bridge ChatConversationInfoView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_callbacks(cr));
switch (newState) {
case LinphoneChatRoomStateCreated:
LOGI(@"Chat room [%p] created on server.", cr);
[view goToChatRoom:cr];
break;
case LinphoneChatRoomStateCreationFailed:
view.waitView.hidden = YES;
[ChatConversationInfoView displayCreationError];
LOGE(@"Chat room [%p] could not be created on server.", cr);
break;
case LinphoneChatRoomStateTerminated:
LOGI(@"Chat room [%p] has been terminated.", cr);
[view goToChatRoom:cr];
break;
default:
break;
}
}
void chat_room_subject_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log) {
ChatConversationInfoView *view = (__bridge ChatConversationInfoView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_callbacks(cr));
view.nameLabel.text = [NSString stringWithUTF8String:linphone_event_log_get_subject(event_log)];

View file

@ -18,7 +18,6 @@
<outlet property="quitButton" destination="Hnm-7C-dBQ" id="Kp1-Aw-FQq"/>
<outlet property="tableView" destination="pMq-Gv-0uu" id="ELS-RQ-olX"/>
<outlet property="view" destination="zgv-a8-72k" id="1Cq-i3-h2W"/>
<outlet property="waitView" destination="gCU-N8-PWM" id="KUB-ax-ALp"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@ -148,18 +147,6 @@
<action selector="onQuitClick:" destination="-1" eventType="touchUpInside" id="TT0-hW-JMh"/>
</connections>
</button>
<view hidden="YES" tag="8" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gCU-N8-PWM" userLabel="waitView">
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<activityIndicatorView opaque="NO" tag="9" contentMode="scaleToFill" fixedFrame="YES" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="QeU-kh-Ycy" userLabel="activityIndicatorView">
<rect key="frame" x="179" y="268" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<gestureRecognizers/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>

View file

@ -196,7 +196,14 @@ static UICompositeViewDescription *compositeDescription = nil;
if (addr == NULL)
return;
ChatConversationView *view = VIEW(ChatConversationView);
LinphoneChatRoom *room = linphone_core_get_chat_room(LC, addr);
const LinphoneAddress *local = linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(LC));
LinphoneChatRoom *room = linphone_core_find_one_to_one_chat_room(LC, local, addr);
if (!room) {
bctbx_list_t *addresses = bctbx_list_new((void*)addr);
[PhoneMainView.instance createChatRoomWithSubject:LINPHONE_DUMMY_SUBJECT andAddresses:addresses];
bctbx_list_free_with_data(addresses, (void (*)(void *))linphone_address_unref);
return;
}
[view setChatRoom:room];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}

View file

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -24,11 +27,11 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="rAa-qu-PDc" userLabel="editView">
<frame key="frameInset" minX="0.0%" minY="0.0%" width="100.00%" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" id="dTn-Hc-bGM" userLabel="editTextField">
<frame key="frameInset" minX="8" minY="15.91%" height="68.18%" maxX="40"/>
<rect key="frame" x="8" y="7" width="327" height="30"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.88286077976226807" green="0.88283431529998779" blue="0.88284933567047119" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<rect key="contentStretch" x="1.3877787807814457e-17" y="0.0" width="1" height="1"/>
@ -36,7 +39,7 @@
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done"/>
</textField>
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="C2f-aP-xjR" userLabel="deleteButton" customClass="UIIconButton">
<frame key="frameInset" minY="50.00%" width="40" height="30"/>
<rect key="frame" x="335" y="7" width="40" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<inset key="contentEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" image="delete_field_default.png">
@ -52,11 +55,11 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<view contentMode="scaleToFill" id="SR2-3m-6t5" userLabel="defaultView">
<frame key="frameInset" minX="0.0%" minY="0.0%" width="100.00%" height="100.00%"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="88"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="ZbV-2Z-b4y" userLabel="callButton" customClass="UIIconButton">
<frame key="frameInset" minX="40.79%" width="44" height="44" maxY="4"/>
<rect key="frame" x="135" y="40" width="44" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<accessibility key="accessibilityConfiguration" label="Call"/>
<state key="normal" image="call_start_body_default.png">
@ -69,7 +72,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="FDT-HY-OQZ" userLabel="chatButton" customClass="UIIconButton">
<frame key="frameInset" minX="58.91%" width="44" height="44" maxY="4"/>
<rect key="frame" x="195" y="40" width="44" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<accessibility key="accessibilityConfiguration" label="Chat"/>
<state key="normal" image="chat_start_body_default.png">
@ -82,14 +85,14 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="frB-ep-LWi" userLabel="addressLabel">
<frame key="frameInset" minX="2.13%" width="95.73%" height="50.00%"/>
<rect key="frame" x="8" y="0.0" width="359" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="linphone_user.png" id="ZaI-29-AOK" userLabel="linphoneImage">
<frame key="frameInset" minY="77.27%" width="25" height="22" maxX="8"/>
<rect key="frame" x="342" y="51" width="25" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
@ -112,9 +115,4 @@
<image name="delete_field_over.png" width="27" height="27"/>
<image name="linphone_user.png" width="26" height="22"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
</simulatedMetricsContainer>
</document>

View file

@ -90,6 +90,16 @@ static const CGFloat NOTIFIED_CELL_HEIGHT = 44;
eventString = NSLocalizedString(formatedString, nil);
break;
}
case LinphoneEventLogTypeConferenceTerminated: {
NSString *formatedString = [NSString stringWithFormat:@"Chat room has been left"];
eventString = NSLocalizedString(formatedString, nil);
break;
}
case LinphoneEventLogTypeConferenceCreated: {
NSString *formatedString = [NSString stringWithFormat:@"Chat room has been entered"];
eventString = NSLocalizedString(formatedString, nil);
break;
}
default:
return;
}

View file

@ -137,8 +137,16 @@
LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:_addressLabel.text];
if (addr == NULL)
return;
const LinphoneAddress *local = linphone_proxy_config_get_contact(linphone_core_get_default_proxy_config(LC));
LinphoneChatRoom *room = linphone_core_find_one_to_one_chat_room(LC, local, addr);
if (!room) {
bctbx_list_t *addresses = bctbx_list_new(addr);
[PhoneMainView.instance createChatRoomWithSubject:LINPHONE_DUMMY_SUBJECT andAddresses:addresses];
bctbx_list_free_with_data(addresses, (void (*)(void *))linphone_address_unref);
return;
}
ChatConversationView *view = VIEW(ChatConversationView);
LinphoneChatRoom *room = linphone_core_get_chat_room(LC, addr);
[view setChatRoom:room];
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
linphone_address_destroy(addr);

View file

@ -86,6 +86,7 @@
@property(weak, readonly) UICompositeViewDescription *currentView;
@property LinphoneChatRoom* currentRoom;
@property(readonly, strong) MPVolumeView *volumeView;
@property (weak, nonatomic) IBOutlet UIView *waitView;
- (void)changeCurrentView:(UICompositeViewDescription *)view;
- (UIViewController*)popCurrentView;
@ -103,6 +104,9 @@
- (BOOL)removeInhibitedEvent:(id)event;
- (void)updateApplicationBadgeNumber;
- (void)createChatRoomWithSubject:(const char *)subject andAddresses:(bctbx_list_t *)addresses;
+ (PhoneMainView*) instance;
@end
void main_view_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState);

View file

@ -172,6 +172,7 @@ static RootViewManager *rootViewManagerInstance = nil;
}
- (void)viewWillAppear:(BOOL)animated {
_waitView.hidden = YES;
[super viewWillAppear:animated];
// Set observers
@ -820,4 +821,46 @@ static RootViewManager *rootViewManagerInstance = nil;
linphone_call_terminate(call);
}
#pragma mark - Chat room Functions
- (void)createChatRoomWithSubject:(const char *)subject andAddresses:(bctbx_list_t *)addresses {
_waitView.hidden = NO;
LinphoneChatRoom *room = linphone_core_create_client_group_chat_room(LC, subject ?: LINPHONE_DUMMY_SUBJECT);
if (!room)
return;
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(room);
linphone_chat_room_cbs_set_state_changed(cbs, main_view_chat_room_state_changed);
linphone_chat_room_cbs_set_user_data(cbs, (__bridge void*)self);
linphone_chat_room_add_participants(room, addresses);
}
- (void)goToChatRoom:(LinphoneChatRoom *)cr {
_waitView.hidden = YES;
ChatConversationView *view = VIEW(ChatConversationView);
view.chatRoom = cr;
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
void main_view_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) {
PhoneMainView *view = (__bridge PhoneMainView *)linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_callbacks(cr));
switch (newState) {
case LinphoneChatRoomStateCreated:
LOGI(@"Chat room [%p] created on server.", cr);
[view goToChatRoom:cr];
break;
case LinphoneChatRoomStateCreationFailed:
view.waitView.hidden = YES;
[ChatConversationInfoView displayCreationError];
LOGE(@"Chat room [%p] could not be created on server.", cr);
break;
case LinphoneChatRoomStateTerminated:
LOGI(@"Chat room [%p] has been terminated.", cr);
[view goToChatRoom:cr];
break;
default:
break;
}
}
@end