diff --git a/Classes/Base.lproj/ChatViewController.xib b/Classes/Base.lproj/ChatViewController.xib
index 3f2afd259..afda726f9 100644
--- a/Classes/Base.lproj/ChatViewController.xib
+++ b/Classes/Base.lproj/ChatViewController.xib
@@ -17,7 +17,7 @@
-
+
diff --git a/Classes/LinphoneUI/UICompositeViewController.h b/Classes/LinphoneUI/UICompositeViewController.h
index fee4d1397..42d914fa7 100644
--- a/Classes/LinphoneUI/UICompositeViewController.h
+++ b/Classes/LinphoneUI/UICompositeViewController.h
@@ -64,8 +64,7 @@
@property (nonatomic, strong) IBOutlet UIView* stateBarView;
@property (nonatomic, strong) IBOutlet UIView* contentView;
@property (nonatomic, strong) IBOutlet UIView* tabBarView;
-@property(weak, nonatomic) IBOutlet UIView *sideMenuView;
-@property(strong, nonatomic) IBOutlet SideMenuTableViewController *sideMenuTableViewController;
+@property(strong, nonatomic) IBOutlet UIView *sideMenuView;
- (void)changeView:(UICompositeViewDescription *)description;
- (void)setFullScreen:(BOOL)enabled;
@@ -77,5 +76,6 @@
- (UIViewController *)getCurrentViewController;
- (UIInterfaceOrientation)currentOrientation;
- (void)clearCache:(NSArray*)exclude;
+- (IBAction)onRightSwipe:(id)sender;
@end
diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m
index c7d36ddda..d32a843aa 100644
--- a/Classes/LinphoneUI/UICompositeViewController.m
+++ b/Classes/LinphoneUI/UICompositeViewController.m
@@ -72,6 +72,7 @@
@property(nonatomic, strong) UIViewController *stateBarViewController;
@property(nonatomic, strong) UIViewController *tabBarViewController;
@property(nonatomic, strong) UIViewController *contentViewController;
+@property(nonatomic, strong) UIViewController *sideMenuViewController;
@end
@@ -83,6 +84,7 @@
@synthesize tabBarViewController = _tabBarViewController;
@synthesize stateBarViewController = _stateBarViewController;
@synthesize contentViewController = _contentViewController;
+@synthesize sideMenuViewController = _sideMenuViewController;
@synthesize viewTransition;
@@ -165,6 +167,9 @@
the device screen size at load */
[self updateViewsFramesAccordingToLaunchOrientation];
[super viewDidLoad];
+
+ _sideMenuViewController = [self getCachedController:@"SideMenuViewController"];
+ [UICompositeViewController addSubView:_sideMenuViewController view:_sideMenuView];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -172,6 +177,7 @@
[self.contentViewController viewWillAppear:animated];
[self.tabBarViewController viewWillAppear:animated];
[self.stateBarViewController viewWillAppear:animated];
+ [self.sideMenuViewController viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(orientationDidChange:)
@@ -185,6 +191,7 @@
[self.contentViewController viewDidAppear:animated];
[self.tabBarViewController viewDidAppear:animated];
[self.stateBarViewController viewDidAppear:animated];
+ [self.sideMenuViewController viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
@@ -192,6 +199,7 @@
[self.contentViewController viewWillDisappear:animated];
[self.tabBarViewController viewWillDisappear:animated];
[self.stateBarViewController viewWillDisappear:animated];
+ [self.sideMenuViewController viewWillDisappear:animated];
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
@@ -203,6 +211,7 @@
[self.contentViewController viewDidDisappear:animated];
[self.tabBarViewController viewDidDisappear:animated];
[self.stateBarViewController viewDidDisappear:animated];
+ [self.sideMenuViewController viewDidDisappear:animated];
}
#pragma mark - Rotation messages
@@ -214,6 +223,7 @@
[self.contentViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.tabBarViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.stateBarViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
+ [self.sideMenuViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
@@ -223,6 +233,7 @@
[self.contentViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
+ [self.sideMenuViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
[self update:nil tabBar:nil stateBar:nil fullscreen:nil];
}
@@ -231,6 +242,7 @@
[self.contentViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self.tabBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self.stateBarViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+ [self.sideMenuViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
@@ -317,6 +329,10 @@
}
}
+- (IBAction)onRightSwipe:(id)sender {
+ [self hideSideMenu:NO];
+}
+
- (UIInterfaceOrientation)currentOrientation {
return currentOrientation;
}
@@ -437,6 +453,7 @@
[self.contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
+ [self.sideMenuViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
}
} else {
if (oldContentViewController != newContentViewController) {
@@ -454,8 +471,11 @@
if (oldStateBarViewController != newStateBarViewController) {
UIInterfaceOrientation oldOrientation = self.stateBarViewController.interfaceOrientation;
[self.stateBarViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
+ [self.sideMenuViewController willRotateToInterfaceOrientation:correctOrientation duration:0];
[self.stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
+ [self.sideMenuViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:0];
[self.stateBarViewController didRotateFromInterfaceOrientation:oldOrientation];
+ [self.sideMenuViewController didRotateFromInterfaceOrientation:oldOrientation];
}
}
} else {
@@ -538,6 +558,11 @@
frame.size.width = [stateBarView bounds].size.width;
[self.stateBarViewController.view setFrame:frame];
+ CGRect sideMenuFrame = contentFrame;
+ sideMenuFrame.size.height += tabFrame.size.height;
+ _sideMenuView.frame = sideMenuFrame;
+ _sideMenuViewController.view.frame = [_sideMenuView bounds];
+
// Commit animation
if (tabBar != nil || stateBar != nil || fullscreen != nil) {
[UIView commitAnimations];
@@ -580,12 +605,17 @@
}
- (void)hideSideMenu:(BOOL)hidden animated:(BOOL)animated {
- LOGI(@"%s side menu", hidden ? "Closing" : "Opening");
+ LOGI(@"%s side menu %s animation", hidden ? "Closing" : "Opening", animated ? "with" : "without");
// resign keyboard, if any
[LinphoneUtils findAndResignFirstResponder:self.view];
CGRect d = _sideMenuView.frame;
+
+ // first replace sidemenuview at the right place, if needed
+ d.origin.x = hidden ? 0 : -d.size.width;
+ _sideMenuView.frame = d;
+
d.origin.x = hidden ? -d.size.width : 0;
if (animated) {
diff --git a/Classes/SideMenuTableViewController.h b/Classes/SideMenuTableViewController.h
index 50456d3f5..0eabedb89 100644
--- a/Classes/SideMenuTableViewController.h
+++ b/Classes/SideMenuTableViewController.h
@@ -22,5 +22,4 @@ typedef void (^SideMenuEntryBlock)(void);
@property(nonatomic, retain) NSMutableArray *sideMenuEntries;
-+ (void)addSideMenuEntry:(SideMenuEntry *)entry;
@end
diff --git a/Classes/SideMenuTableViewController.m b/Classes/SideMenuTableViewController.m
index dcc515f23..8a4448660 100644
--- a/Classes/SideMenuTableViewController.m
+++ b/Classes/SideMenuTableViewController.m
@@ -26,18 +26,12 @@
@implementation SideMenuTableViewController
-+ (void)addSideMenuEntry:(SideMenuEntry *)entry {
- SideMenuTableViewController *this = PhoneMainView.instance.mainViewController.sideMenuTableViewController;
- [this.sideMenuEntries addObject:entry];
-}
-
- (void)viewDidLoad {
_sideMenuEntries = [[NSMutableArray alloc] init];
[_sideMenuEntries
addObject:[[SideMenuEntry alloc] initWithTitle:NSLocalizedString(@"Settings", nil)
tapBlock:^() {
-
[PhoneMainView.instance
changeCurrentView:SettingsViewController.compositeViewDescription];
}]];
diff --git a/Classes/SideMenuViewController.h b/Classes/SideMenuViewController.h
new file mode 100644
index 000000000..1f6f263db
--- /dev/null
+++ b/Classes/SideMenuViewController.h
@@ -0,0 +1,20 @@
+//
+// SideMenuViewController.h
+// linphone
+//
+// Created by Gautier Pelloux-Prayer on 28/07/15.
+//
+//
+
+#import
+
+#import "SideMenuTableViewController.h"
+
+@interface SideMenuViewController : UIViewController
+@property(weak, nonatomic) IBOutlet UIImageView *avatarImage;
+@property(weak, nonatomic) IBOutlet UILabel *nameLabel;
+@property(weak, nonatomic) IBOutlet UILabel *addressLabel;
+@property(strong, nonatomic) IBOutlet SideMenuTableViewController *sideMenuTableViewController;
+- (IBAction)onLateralSwipe:(id)sender;
+
+@end
diff --git a/Classes/SideMenuViewController.m b/Classes/SideMenuViewController.m
new file mode 100644
index 000000000..b0ee4463b
--- /dev/null
+++ b/Classes/SideMenuViewController.m
@@ -0,0 +1,32 @@
+//
+// SideMenuViewController.m
+// linphone
+//
+// Created by Gautier Pelloux-Prayer on 28/07/15.
+//
+//
+
+#import "SideMenuViewController.h"
+#import "LinphoneManager.h"
+#import "PhoneMainView.h"
+
+@implementation SideMenuViewController
+
+#pragma mark - Lifecycle Functions
+
+- (id)init {
+ return [super initWithNibName:@"SideMenuViewController" bundle:[NSBundle mainBundle]];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+ LinphoneProxyConfig *default_proxy = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
+ linphone_proxy_config_get [FastAddressBook setDisplayNameLabel:_nameLabel forAddress:@"toto replace me"];
+ [FastAddressBook setDisplayNameLabel:_addressLabel forAddress:@"yolo"];
+ [FastAddressBook getContactImage:nil thumbnail:NO];
+}
+
+- (IBAction)onLateralSwipe:(id)sender {
+ LOGI(@"Swipe!");
+ [[PhoneMainView instance].mainViewController hideSideMenu:YES];
+}
+@end
diff --git a/Classes/SideMenuViewController.xib b/Classes/SideMenuViewController.xib
new file mode 100644
index 000000000..9340abfaf
--- /dev/null
+++ b/Classes/SideMenuViewController.xib
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj
index 08590cbc5..8582caea2 100755
--- a/linphone.xcodeproj/project.pbxproj
+++ b/linphone.xcodeproj/project.pbxproj
@@ -108,6 +108,8 @@
632DA24D1B43EE9400EB356A /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = D35860D515B549B500513429 /* Utils.m */; };
632DA24E1B43EEEF00EB356A /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = D35860D515B549B500513429 /* Utils.m */; };
633756391B67BAF400E21BAD /* SideMenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 633756381B67BAF400E21BAD /* SideMenuTableViewController.m */; };
+ 633756451B67D2B200E21BAD /* SideMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 633756431B67D2B100E21BAD /* SideMenuViewController.m */; };
+ 633756461B67D2B200E21BAD /* SideMenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 633756441B67D2B100E21BAD /* SideMenuViewController.xib */; };
634610061B61330300548952 /* UILabel+Boldify.m in Sources */ = {isa = PBXBuildFile; fileRef = 634610051B61330300548952 /* UILabel+Boldify.m */; };
6346100F1B61409800548952 /* OutgoingCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6346100E1B61409800548952 /* OutgoingCallViewController.m */; };
634610121B6140A500548952 /* OutgoingCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 634610101B6140A500548952 /* OutgoingCallViewController.xib */; };
@@ -659,6 +661,9 @@
63158FAC1B468E0E00969917 /* ImageOptim.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = ImageOptim.sh; path = Tools/ImageOptim.sh; sourceTree = ""; };
633756371B67BAF400E21BAD /* SideMenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SideMenuTableViewController.h; sourceTree = ""; };
633756381B67BAF400E21BAD /* SideMenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SideMenuTableViewController.m; sourceTree = ""; };
+ 633756421B67D2B100E21BAD /* SideMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SideMenuViewController.h; sourceTree = ""; };
+ 633756431B67D2B100E21BAD /* SideMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SideMenuViewController.m; sourceTree = ""; };
+ 633756441B67D2B100E21BAD /* SideMenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SideMenuViewController.xib; sourceTree = ""; };
633E388219FFB0F400936D1C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
634610041B61330300548952 /* UILabel+Boldify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Boldify.h"; sourceTree = ""; };
634610051B61330300548952 /* UILabel+Boldify.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Boldify.m"; sourceTree = ""; };
@@ -1329,6 +1334,9 @@
D3D5126A160B3A8E00946DF8 /* WizardViews.xib */,
633756371B67BAF400E21BAD /* SideMenuTableViewController.h */,
633756381B67BAF400E21BAD /* SideMenuTableViewController.m */,
+ 633756421B67D2B100E21BAD /* SideMenuViewController.h */,
+ 633756431B67D2B100E21BAD /* SideMenuViewController.m */,
+ 633756441B67D2B100E21BAD /* SideMenuViewController.xib */,
);
path = Classes;
sourceTree = "";
@@ -2203,6 +2211,7 @@
D38187D115FE346B00C3EDCA /* HistoryViewController.xib in Resources */,
634CEDA51B6630DB00D7A921 /* call_start_body_disabled.png in Resources */,
D38187BD15FE342800C3EDCA /* ContactsViewController.xib in Resources */,
+ 633756461B67D2B200E21BAD /* SideMenuViewController.xib in Resources */,
634CED9B1B6630DB00D7A921 /* call_alt_start.png in Resources */,
634CEE031B6630DB00D7A921 /* security_ko.png in Resources */,
634CEDAE1B6630DB00D7A921 /* camera_switch_default.png in Resources */,
@@ -2448,6 +2457,7 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* LinphoneAppDelegate.m in Sources */,
22F2508E107141E100AC9B3F /* DialerViewController.m in Sources */,
+ 633756451B67D2B200E21BAD /* SideMenuViewController.m in Sources */,
22E0A822111C44E100B04932 /* AboutViewController.m in Sources */,
634610061B61330300548952 /* UILabel+Boldify.m in Sources */,
2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */,
diff --git a/submodules/linphone b/submodules/linphone
index 04c43a9f6..e0b013c8b 160000
--- a/submodules/linphone
+++ b/submodules/linphone
@@ -1 +1 @@
-Subproject commit 04c43a9f64db5152e2859528c40dbd79008ccf5b
+Subproject commit e0b013c8bb630be19540b132ba1b94354384c175