From ac92a40ed31a41e58b39215aba8c171aa17761ca Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 31 Jul 2015 17:00:59 +0200 Subject: [PATCH] mainbar: add selected bar --- Classes/LinphoneUI/Base.lproj/UIMainBar.xib | 16 +++++++++++----- Classes/LinphoneUI/UIMainBar.h | 3 +-- Classes/LinphoneUI/UIMainBar.m | 11 +++++++++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Classes/LinphoneUI/Base.lproj/UIMainBar.xib b/Classes/LinphoneUI/Base.lproj/UIMainBar.xib index 3faeab8bd..766863b97 100644 --- a/Classes/LinphoneUI/Base.lproj/UIMainBar.xib +++ b/Classes/LinphoneUI/Base.lproj/UIMainBar.xib @@ -16,6 +16,7 @@ + @@ -24,7 +25,7 @@ - - - - + + + + + @@ -115,7 +121,7 @@ - + diff --git a/Classes/LinphoneUI/UIMainBar.h b/Classes/LinphoneUI/UIMainBar.h index b2802dda7..4177d4ed5 100644 --- a/Classes/LinphoneUI/UIMainBar.h +++ b/Classes/LinphoneUI/UIMainBar.h @@ -26,17 +26,16 @@ @property (nonatomic, strong) IBOutlet UIButton* historyButton; @property (nonatomic, strong) IBOutlet UIButton* contactsButton; @property (nonatomic, strong) IBOutlet UIButton* dialerButton; -@property (nonatomic, strong) IBOutlet UIButton* settingsButton; @property (nonatomic, strong) IBOutlet UIButton* chatButton; @property (nonatomic, strong) IBOutlet UIView *historyNotificationView; @property (nonatomic, strong) IBOutlet UILabel *historyNotificationLabel; @property (nonatomic, strong) IBOutlet UIView *chatNotificationView; @property (nonatomic, strong) IBOutlet UILabel *chatNotificationLabel; +@property(weak, nonatomic) IBOutlet UIView *selectedBtnView; -(IBAction) onHistoryClick: (id) event; -(IBAction) onContactsClick: (id) event; -(IBAction) onDialerClick: (id) event; --(IBAction) onSettingsClick: (id) event; -(IBAction) onChatClick: (id) event; @end diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index 210db0d4f..fe2c05088 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -30,7 +30,6 @@ static NSString *const kDisappearAnimation = @"disappear"; @synthesize historyButton; @synthesize contactsButton; @synthesize dialerButton; -@synthesize settingsButton; @synthesize chatButton; @synthesize historyNotificationView; @synthesize historyNotificationLabel; @@ -222,8 +221,16 @@ static NSString *const kDisappearAnimation = @"disappear"; historyButton.selected = [view equal:[HistoryViewController compositeViewDescription]]; contactsButton.selected = [view equal:[ContactsViewController compositeViewDescription]]; dialerButton.selected = [view equal:[DialerViewController compositeViewDescription]]; - settingsButton.selected = [view equal:[SettingsViewController compositeViewDescription]]; chatButton.selected = [view equal:[ChatViewController compositeViewDescription]]; + CGRect selectedNewFrame = _selectedBtnView.frame; + selectedNewFrame.origin.x = + (historyButton.selected + ? historyButton.frame.origin.x + : (contactsButton.selected + ? contactsButton.frame.origin.x + : (dialerButton.selected ? dialerButton.frame.origin.x + : (chatButton.selected ? chatButton.frame.origin.x : 0)))); + _selectedBtnView.frame = selectedNewFrame; } #pragma mark - Action Functions