Sidemenu: add registration icon and other stuff

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-28 17:44:33 +01:00
parent 2fd0c1d724
commit 71804f070c
268 changed files with 1752 additions and 938 deletions

View file

@ -64,7 +64,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if (compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:self.class
statusBar:StatusBarView.class
tabBar:TabBarView.class
tabBar:nil
sideMenu:SideMenuView.class
fullscreen:false
landscapeMode:LinphoneManager.runningOnIpad

View file

@ -20,6 +20,7 @@
#import <UIKit/UIKit.h>
#import "TPMultiLayoutViewController.h"
#import "UIConfirmationDialog.h"
#import "LinphoneManager.h"
@interface StatusBarView : TPMultiLayoutViewController {
UIConfirmationDialog *securityDialog;
@ -36,5 +37,5 @@
- (IBAction)onSecurityClick:(id)sender;
- (IBAction)onSideMenuClick:(id)sender;
- (IBAction)onRegistrationStateClick:(id)sender;
+ (UIImage *)imageForState:(LinphoneRegistrationState)state;
@end

View file

@ -154,10 +154,22 @@
#pragma mark -
+ (UIImage *)imageForState:(LinphoneRegistrationState)state {
switch (state) {
case LinphoneRegistrationFailed:
return [UIImage imageNamed:@"led_error.png"];
case LinphoneRegistrationCleared:
case LinphoneRegistrationNone:
return [UIImage imageNamed:@"led_disconnected.png"];
case LinphoneRegistrationProgress:
return [UIImage imageNamed:@"led_inprogress.png"];
case LinphoneRegistrationOk:
return [UIImage imageNamed:@"led_connected.png"];
}
}
- (void)proxyConfigUpdate:(LinphoneProxyConfig *)config {
LinphoneRegistrationState state = LinphoneRegistrationNone;
NSString *message = nil;
UIImage *image = nil;
LinphoneCore *lc = [LinphoneManager getLc];
LinphoneGlobalState gstate = linphone_core_get_global_state(lc);
@ -190,25 +202,9 @@
break;
}
}
switch (state) {
case LinphoneRegistrationFailed:
image = [UIImage imageNamed:@"led_error.png"];
break;
case LinphoneRegistrationCleared:
case LinphoneRegistrationNone:
image = [UIImage imageNamed:@"led_disconnected.png"];
break;
case LinphoneRegistrationProgress:
image = [UIImage imageNamed:@"led_inprogress.png"];
break;
case LinphoneRegistrationOk:
image = [UIImage imageNamed:@"led_connected.png"];
break;
}
[_registrationState setTitle:message forState:UIControlStateNormal];
_registrationState.accessibilityValue = message;
[_registrationState setImage:image forState:UIControlStateNormal];
[_registrationState setImage:[self.class imageForState:state] forState:UIControlStateNormal];
}
#pragma mark -

View file

@ -112,7 +112,7 @@
<rect key="frame" x="307" y="0.0" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="6dA-3U-OPW" userLabel="bottomBarColor">
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="6dA-3U-OPW" userLabel="bottomBarColor">
<rect key="frame" x="0.0" y="129" width="322" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
</imageView>

View file

@ -76,7 +76,7 @@
<rect key="frame" x="307" y="0.0" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="mlr-pl-B6T" userLabel="bottomBarColor">
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="mlr-pl-B6T" userLabel="bottomBarColor">
<rect key="frame" x="0.0" y="160" width="322" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
</imageView>

View file

@ -631,46 +631,7 @@
- (void)hideSideMenu:(BOOL)hidden {
[self update:nil tabBar:nil statusBar:nil sideMenu:[NSNumber numberWithBool:!hidden] fullscreen:nil];
// [self hideSideMenu:hidden
// animated:[[LinphoneManager instance] lpConfigBoolForKey:@"animations_preference" withDefault:YES]];
}
//- (void)hideSideMenu:(BOOL)hidden animated:(BOOL)animated {
// LOGI(@"%s side menu %s animation", hidden ? "Closing" : "Opening", animated ? "with" : "without");
//
// // resign keyboard, if any
// [LinphoneUtils findAndResignFirstResponder:self.view];
//
// CGRect d = self.sideMenuView.frame;
// d.origin.x = hidden ? 0 : -d.size.width;
// self.sideMenuView.frame = d;
// d.origin.x = hidden ? -d.size.width : 0;
//
// if (animated) {
// self.sideMenuView.hidden = NO;
// [UIView animateWithDuration:0.3
// animations:^{
// self.sideMenuView.frame = d;
// }
// completion:^(BOOL finished) {
// self.sideMenuView.hidden = hidden;
// if (hidden) {
// [self.sideMenuViewController viewWillDisappear:animated];
// } else {
// [self.sideMenuViewController viewWillAppear:animated];
// }
// }];
// } else {
// self.sideMenuView.frame = d;
// self.sideMenuView.hidden = hidden;
// if (hidden) {
// [self.sideMenuViewController viewWillDisappear:animated];
// } else {
// [self.sideMenuViewController viewWillAppear:animated];
// }
// }
//}
- (UIViewController *)getCurrentViewController {
return self.contentViewController;
}

View file

@ -0,0 +1,13 @@
//
// UIRightImageButton.h
// linphone
//
// Created by Gautier Pelloux-Prayer on 28/10/15.
//
//
#import <UIKit/UIKit.h>
@interface UIRightImageButton : UIButton
@end

View file

@ -0,0 +1,35 @@
//
// UIRightImageButton.m
// linphone
//
// Created by Gautier Pelloux-Prayer on 28/10/15.
//
//
#import "UIRightImageButton.h"
@implementation UIRightImageButton
- (instancetype)invertImage {
self.transform = CGAffineTransformMakeScale(-1.0, 1.0);
self.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0);
self.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
self.contentHorizontalAlignment = (self.contentHorizontalAlignment == UIControlContentHorizontalAlignmentLeft)
? UIControlContentHorizontalAlignmentRight
: UIControlContentHorizontalAlignmentLeft;
return self;
}
- (instancetype)init {
return [[super init] invertImage];
}
- (id)initWithCoder:(NSCoder *)aDecoder {
return [[super initWithCoder:aDecoder] invertImage];
}
- (instancetype)initWithFrame:(CGRect)frame {
return [[super initWithFrame:frame] invertImage];
}
@end

View file

@ -352,7 +352,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if (compositeDescription == nil) {
compositeDescription = [[UICompositeViewDescription alloc] init:self.class
statusBar:StatusBarView.class
tabBar:TabBarView.class
tabBar:nil
sideMenu:SideMenuView.class
fullscreen:false
landscapeMode:LinphoneManager.runningOnIpad

View file

@ -15,7 +15,7 @@
@property(weak, nonatomic) IBOutlet UIRoundedImageView *avatarImage;
@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
@property(weak, nonatomic) IBOutlet UILabel *addressLabel;
@property(weak, nonatomic) IBOutlet UIButton *addressButton;
@property(strong, nonatomic) IBOutlet SideMenuTableView *sideMenuTableViewController;
- (IBAction)onLateralSwipe:(id)sender;
- (IBAction)onHeaderClick:(id)sender;

View file

@ -18,11 +18,14 @@
const LinphoneAddress *addr = linphone_proxy_config_get_identity_address(default_proxy);
[ContactDisplay setDisplayNameLabel:_nameLabel forAddress:addr];
char *as_string = linphone_address_as_string(addr);
_addressLabel.text = [NSString stringWithUTF8String:as_string];
[_addressButton setTitle:[NSString stringWithUTF8String:as_string] forState:UIControlStateNormal];
ms_free(as_string);
[_addressButton setImage:[StatusBarView imageForState:linphone_proxy_config_get_state(default_proxy)]
forState:UIControlStateNormal];
} else {
_nameLabel.text = @"No account";
_addressLabel.text = NSLocalizedString(@"No address", nil);
[_addressButton setTitle:NSLocalizedString(@"No address", nil) forState:UIControlStateNormal];
[_addressButton setImage:nil forState:UIControlStateNormal];
}
[LinphoneUtils setSelfAvatar:_avatarImage];
}

View file

@ -7,7 +7,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SideMenuView">
<connections>
<outlet property="addressLabel" destination="aQ3-qc-xBv" id="ZhC-Tf-3Tn"/>
<outlet property="addressButton" destination="MFj-XQ-w5V" id="EPi-6H-59a"/>
<outlet property="avatarImage" destination="BNQ-7N-NGT" id="LXr-Yr-zSK"/>
<outlet property="nameLabel" destination="XbU-2B-u1b" id="rKF-4e-1HA"/>
<outlet property="sideMenuTableViewController" destination="Yyh-z6-IGO" id="6Xq-OQ-vYm"/>
@ -35,38 +35,40 @@
<subviews>
<imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_F.png" id="90B-Re-hmt" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="300" height="100"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="XbU-2B-u1b" userLabel="nameLabel">
<rect key="frame" x="76" y="15" width="224" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="tailTruncation" id="MFj-XQ-w5V" userLabel="adressButton" customClass="UIRightImageButton">
<rect key="frame" x="76" y="54" width="224" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="titleEdgeInsets" minX="3" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="john.doe@sip.linphone.org" image="led_connected.png">
<color key="titleColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar.png" id="BNQ-7N-NGT" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="0.0" y="5" width="90" height="90"/>
<rect key="frame" x="8" y="20" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<outletCollection property="gestureRecognizers" destination="Kej-uL-ntg" appends="YES" id="eog-XV-xok"/>
</connections>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="XbU-2B-u1b" userLabel="nameLabel">
<rect key="frame" x="98" y="15" width="194" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" id="aQ3-qc-xBv" userLabel="addressLabel">
<rect key="frame" x="98" y="54" width="194" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<gestureRecognizers/>
<connections>
<outletCollection property="gestureRecognizers" destination="1kD-az-BAx" appends="YES" id="OGc-fj-HQy"/>
</connections>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Ttt-1k-jAm">
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Ttt-1k-jAm">
<rect key="frame" x="0.0" y="100" width="300" height="532"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="Yyh-z6-IGO" id="ytx-b8-NGX"/>
@ -107,6 +109,7 @@
<resources>
<image name="avatar.png" width="255" height="255"/>
<image name="color_F.png" width="2" height="2"/>
<image name="led_connected.png" width="11" height="11"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,009 B

After

Width:  |  Height:  |  Size: 1,009 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,002 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

Some files were not shown because too many files have changed in this diff Show more