diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index a1f0231440..e812f9ea9d 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -269,6 +269,8 @@ if (is_ios || (is_mac && target_cpu != "x86")) { "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png", "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png", "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png", + "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png", + "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png", "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png", "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png", "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png", diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDAppDelegate.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDAppDelegate.m index 8f19262305..3cdccd9de0 100644 --- a/webrtc/examples/objc/AppRTCMobile/ios/ARDAppDelegate.m +++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDAppDelegate.m @@ -31,7 +31,11 @@ _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [_window makeKeyAndVisible]; ARDMainViewController *viewController = [[ARDMainViewController alloc] init]; - _window.rootViewController = viewController; + + UINavigationController *root = + [[UINavigationController alloc] initWithRootViewController:viewController]; + root.navigationBar.translucent = NO; + _window.rootViewController = root; #if defined(NDEBUG) // In debug builds the default level is LS_INFO and in non-debug builds it is diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m index 9ebee5c099..20340366c5 100644 --- a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m +++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m @@ -114,7 +114,6 @@ static CGFloat const kCallControlMargin = 8; @end @implementation ARDMainView { - UILabel *_appLabel; ARDRoomTextField *_roomText; UILabel *_callOptionsLabel; UISwitch *_audioOnlySwitch; @@ -136,13 +135,6 @@ static CGFloat const kCallControlMargin = 8; - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - _appLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - _appLabel.text = @"AppRTCMobile"; - _appLabel.font = [UIFont fontWithName:@"Roboto" size:34]; - _appLabel.textColor = [UIColor colorWithWhite:0 alpha:.2]; - [_appLabel sizeToFit]; - [self addSubview:_appLabel]; - _roomText = [[ARDRoomTextField alloc] initWithFrame:CGRectZero]; [self addSubview:_roomText]; @@ -263,11 +255,8 @@ static CGFloat const kCallControlMargin = 8; CGRect bounds = self.bounds; CGFloat roomTextWidth = bounds.size.width - 2 * kRoomTextFieldMargin; CGFloat roomTextHeight = [_roomText sizeThatFits:bounds.size].height; - _roomText.frame = CGRectMake(kRoomTextFieldMargin, - kStatusBarHeight + kRoomTextFieldMargin, - roomTextWidth, - roomTextHeight); - _appLabel.center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)); + _roomText.frame = + CGRectMake(kRoomTextFieldMargin, kRoomTextFieldMargin, roomTextWidth, roomTextHeight); CGFloat callOptionsLabelTop = CGRectGetMaxY(_roomText.frame) + kCallControlMargin * 4; diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m index e392168dee..f7e03bc72f 100644 --- a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m +++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m @@ -21,6 +21,8 @@ #import "ARDMainView.h" #import "ARDVideoCallViewController.h" +static NSString *barButtonImageString = @"ic_settings_black_24dp.png"; + @interface ARDMainViewController () < ARDMainViewDelegate, ARDVideoCallViewControllerDelegate, @@ -34,9 +36,11 @@ } - (void)loadView { + self.title = @"AppRTC Mobile"; _mainView = [[ARDMainView alloc] initWithFrame:CGRectZero]; _mainView.delegate = self; self.view = _mainView; + [self addSettingsBarButton]; RTCAudioSessionConfiguration *webRTCConfig = [RTCAudioSessionConfiguration webRTCConfiguration]; @@ -51,6 +55,15 @@ [self setupAudioPlayer]; } +- (void)addSettingsBarButton { + UIBarButtonItem *settingsButton = + [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:barButtonImageString] + style:UIBarButtonItemStylePlain + target:self + action:@selector(showSettings:)]; + self.navigationItem.rightBarButtonItem = settingsButton; +} + #pragma mark - ARDMainViewDelegate - (void)mainView:(ARDMainView *)mainView @@ -155,6 +168,8 @@ } #pragma mark - Private +- (void)showSettings:(id)sender { +} - (void)configureAudioSession { RTCAudioSessionConfiguration *configuration = diff --git a/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png b/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png new file mode 100644 index 0000000000..c59419c02b Binary files /dev/null and b/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png differ diff --git a/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png b/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png new file mode 100644 index 0000000000..e84e188a1d Binary files /dev/null and b/webrtc/examples/objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png differ