Merge branch 'develop' into feature/molecule_radio_button
This commit is contained in:
commit
714b153b6a
@ -116,6 +116,7 @@
|
|||||||
- (void)inputFromDatePickerFromDate:(nullable NSDate *)fromDate toDate:(nullable NSDate *)toDate showFromDateAsDefaultInput:(BOOL)show;
|
- (void)inputFromDatePickerFromDate:(nullable NSDate *)fromDate toDate:(nullable NSDate *)toDate showFromDateAsDefaultInput:(BOOL)show;
|
||||||
- (void)setDatePickerFromDate:(nullable NSDate *)fromDate toDate:(nullable NSDate *)toDate;
|
- (void)setDatePickerFromDate:(nullable NSDate *)fromDate toDate:(nullable NSDate *)toDate;
|
||||||
- (nonnull NSDate *)dismissDatePicker;
|
- (nonnull NSDate *)dismissDatePicker;
|
||||||
|
- (void)dismissPicker;
|
||||||
|
|
||||||
//get all enabled textfields, can be pairly used with the primary button's handleEnablingWithTextFields if you only want the enable testfield's validation to be tested
|
//get all enabled textfields, can be pairly used with the primary button's handleEnablingWithTextFields if you only want the enable testfield's validation to be tested
|
||||||
+ (nullable NSArray *)getEnabledTextfields:(nullable NSArray <MFTextField *>*)textFieldToDetermine;
|
+ (nullable NSArray *)getEnabledTextfields:(nullable NSArray <MFTextField *>*)textFieldToDetermine;
|
||||||
|
|||||||
@ -181,6 +181,10 @@
|
|||||||
return pickedDate;
|
return pickedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)dismissPicker {
|
||||||
|
[self.textField resignFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setErrorMessage:(NSString *)errorMessage {
|
- (void)setErrorMessage:(NSString *)errorMessage {
|
||||||
|
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
|
|||||||
@ -279,7 +279,7 @@
|
|||||||
|
|
||||||
- (void)updateNavigationBarUI:(nonnull UINavigationController *)navigationController {
|
- (void)updateNavigationBarUI:(nonnull UINavigationController *)navigationController {
|
||||||
if (navigationController) {
|
if (navigationController) {
|
||||||
[navigationController setNavigationBarHidden:[self navigationBarHidden] animated:NO];
|
[navigationController setNavigationBarHidden:[self navigationBarHidden] animated:YES];
|
||||||
|
|
||||||
[UIColor mfSetBackgroundColorForNavigationBar:[self navigationBarColor] navigationBar:navigationController.navigationBar transparent:[self navigationBarTransparent]];
|
[UIColor mfSetBackgroundColorForNavigationBar:[self navigationBarColor] navigationBar:navigationController.navigationBar transparent:[self navigationBarTransparent]];
|
||||||
|
|
||||||
@ -297,6 +297,7 @@
|
|||||||
|
|
||||||
if (navigationController == [MVMCoreUISplitViewController mainSplitViewController].navigationController) {
|
if (navigationController == [MVMCoreUISplitViewController mainSplitViewController].navigationController) {
|
||||||
// Update icons if main navigation controller.
|
// Update icons if main navigation controller.
|
||||||
|
[[MVMCoreUISession sharedGlobal].splitViewController setupPanels];
|
||||||
[self setMasterShouldBeAccessible:self.masterShouldBeAccessible];
|
[self setMasterShouldBeAccessible:self.masterShouldBeAccessible];
|
||||||
[self setSupportShouldBeAccessible:self.supportShouldBeAccessible];
|
[self setSupportShouldBeAccessible:self.supportShouldBeAccessible];
|
||||||
[self showBottomProgressBar];
|
[self showBottomProgressBar];
|
||||||
|
|||||||
@ -21,6 +21,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (void)panelWillDisappear:(nonnull NSObject <MVMCoreUIPanelProtocol>*)panel;
|
- (void)panelWillDisappear:(nonnull NSObject <MVMCoreUIPanelProtocol>*)panel;
|
||||||
- (void)panelDidDisappear:(nonnull NSObject <MVMCoreUIPanelProtocol>*)panel;
|
- (void)panelDidDisappear:(nonnull NSObject <MVMCoreUIPanelProtocol>*)panel;
|
||||||
|
|
||||||
|
/// Can override the left panel.
|
||||||
|
- (nullable UIViewController <MVMCoreUIPanelProtocol>*)overrideLeftPanel;
|
||||||
|
|
||||||
|
/// Can override the right panel.
|
||||||
|
- (nullable UIViewController <MVMCoreUIPanelProtocol>*)overrideRightPanel;
|
||||||
|
|
||||||
// Called when the back button is pressed. Overwrite for special functionality.
|
// Called when the back button is pressed. Overwrite for special functionality.
|
||||||
- (void)backButtonPressed;
|
- (void)backButtonPressed;
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
// Copyright © 2017 Verizon Wireless. All rights reserved.
|
// Copyright © 2017 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <UIKit/UIKit.h>
|
||||||
@protocol MVMCoreUIPanelProtocol <NSObject>
|
@protocol MVMCoreUIPanelProtocol <NSObject>
|
||||||
|
|
||||||
#pragma mark - life cycle
|
#pragma mark - life cycle
|
||||||
@ -33,6 +33,12 @@
|
|||||||
- (void)showArrow;
|
- (void)showArrow;
|
||||||
- (void)hideArrow;
|
- (void)hideArrow;
|
||||||
|
|
||||||
|
/// The width to use if the panel is automatically extended when the screen is big enough.
|
||||||
|
- (CGFloat)panelExtendedWidth;
|
||||||
|
|
||||||
|
/// The maximum width of the panel.
|
||||||
|
- (CGFloat)panelMaxWidth;
|
||||||
|
|
||||||
// Gets called when we are restarting or clearing a session.
|
// Gets called when we are restarting or clearing a session.
|
||||||
- (void)clearData;
|
- (void)clearData;
|
||||||
|
|
||||||
|
|||||||
@ -80,6 +80,9 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
|||||||
// contains speicaly logic to set the icon color
|
// contains speicaly logic to set the icon color
|
||||||
- (void)setNavigationIconColor:(nullable UIColor *)color;
|
- (void)setNavigationIconColor:(nullable UIColor *)color;
|
||||||
|
|
||||||
|
/// Updates the panels that are used.
|
||||||
|
- (void)setupPanels;
|
||||||
|
|
||||||
#pragma mark - Bottom Progress Bar
|
#pragma mark - Bottom Progress Bar
|
||||||
|
|
||||||
- (void)setBottomProgressBarProgress:(float)progress;
|
- (void)setBottomProgressBarProgress:(float)progress;
|
||||||
@ -114,7 +117,7 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
|||||||
// Can subclass to set threshold for when the drawers are permanently extended. Default is 1000 for the left panel and 2000 for both.
|
// Can subclass to set threshold for when the drawers are permanently extended. Default is 1000 for the left panel and 2000 for both.
|
||||||
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(nullable NSNumber *)forWidth;
|
- (MFNumberOfDrawers)numberOfDrawersShouldShow:(nullable NSNumber *)forWidth;
|
||||||
|
|
||||||
// subclass to return panels
|
// subclass to return default global panels. kept alive after creation.
|
||||||
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createLeftPanelViewController;
|
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createLeftPanelViewController;
|
||||||
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createRightPanelViewController;
|
- (nullable UIViewController <MVMCoreUIPanelProtocol> *)createRightPanelViewController;
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,12 @@
|
|||||||
|
|
||||||
@interface MVMCoreUISplitViewController ()
|
@interface MVMCoreUISplitViewController ()
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSInteger, MFExtendedDrawer) {
|
||||||
|
MFExtendedDrawerNone = 0,
|
||||||
|
MFExtendedDrawerRight,
|
||||||
|
MFExtendedDrawerLeft
|
||||||
|
};
|
||||||
|
|
||||||
@property (weak, nonatomic) UIView *leftView;
|
@property (weak, nonatomic) UIView *leftView;
|
||||||
@property (weak, nonatomic) UIView *mainView;
|
@property (weak, nonatomic) UIView *mainView;
|
||||||
@property (weak, nonatomic) UIView *rightView;
|
@property (weak, nonatomic) UIView *rightView;
|
||||||
@ -38,6 +44,10 @@
|
|||||||
@property (weak, nonatomic) UIView *leftPanelSeparator;
|
@property (weak, nonatomic) UIView *leftPanelSeparator;
|
||||||
@property (weak, nonatomic) UIView *rightPanelSeparator;
|
@property (weak, nonatomic) UIView *rightPanelSeparator;
|
||||||
|
|
||||||
|
// For keeping
|
||||||
|
@property (strong, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *globalLeftPanel;
|
||||||
|
@property (strong, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *globalRightPanel;
|
||||||
|
|
||||||
@property (weak, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *leftPanel;
|
@property (weak, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *leftPanel;
|
||||||
@property (weak, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *rightPanel;
|
@property (weak, nonatomic, readwrite) UIViewController <MVMCoreUIPanelProtocol> *rightPanel;
|
||||||
@property (weak, nonatomic, readwrite) MVMCoreUINavigationController *navigationController;
|
@property (weak, nonatomic, readwrite) MVMCoreUINavigationController *navigationController;
|
||||||
@ -51,13 +61,7 @@
|
|||||||
@property (nonatomic, strong) UIGestureRecognizer *tapToDismissGesture;
|
@property (nonatomic, strong) UIGestureRecognizer *tapToDismissGesture;
|
||||||
|
|
||||||
@property (nullable, readwrite, weak, nonatomic) NSObject <MVMCoreUIPanelProtocol> *explictlyShowingPanel;
|
@property (nullable, readwrite, weak, nonatomic) NSObject <MVMCoreUIPanelProtocol> *explictlyShowingPanel;
|
||||||
@property (nullable, weak, nonatomic) NSObject <MVMCoreUIPanelProtocol> *prioritizedExtendedPanel;
|
@property (nonatomic) MFExtendedDrawer prioritizedExtendedPanel;
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSInteger, MFExtendedDrawer) {
|
|
||||||
MFExtendedDrawerNone = 0,
|
|
||||||
MFExtendedDrawerRight,
|
|
||||||
MFExtendedDrawerLeft
|
|
||||||
};
|
|
||||||
|
|
||||||
@property (nonatomic) MFExtendedDrawer extendedDrawers;
|
@property (nonatomic) MFExtendedDrawer extendedDrawers;
|
||||||
@property (nonatomic, readwrite) BOOL leftPanelIsAccessible;
|
@property (nonatomic, readwrite) BOOL leftPanelIsAccessible;
|
||||||
@ -119,18 +123,30 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)leftPanelExtendedWidth {
|
- (CGFloat)leftPanelExtendedWidth {
|
||||||
|
if ([self.leftPanel respondsToSelector:@selector(panelExtendedWidth)]) {
|
||||||
|
return [self.leftPanel panelExtendedWidth];
|
||||||
|
}
|
||||||
return 320;
|
return 320;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)leftPanelMaxWidth {
|
- (CGFloat)leftPanelMaxWidth {
|
||||||
|
if ([self.leftPanel respondsToSelector:@selector(panelMaxWidth)]) {
|
||||||
|
return [self.leftPanel panelMaxWidth];
|
||||||
|
}
|
||||||
return 415;
|
return 415;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)rightPanelExtendedWidth {
|
- (CGFloat)rightPanelExtendedWidth {
|
||||||
|
if ([self.rightPanel respondsToSelector:@selector(panelExtendedWidth)]) {
|
||||||
|
return [self.rightPanel panelExtendedWidth];
|
||||||
|
}
|
||||||
return 320;
|
return 320;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)rightPanelMaxWidth {
|
- (CGFloat)rightPanelMaxWidth {
|
||||||
|
if ([self.rightPanel respondsToSelector:@selector(panelMaxWidth)]) {
|
||||||
|
return [self.rightPanel panelMaxWidth];
|
||||||
|
}
|
||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +233,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
return NO;
|
return NO;
|
||||||
} else {
|
} else {
|
||||||
// left is extended if the right panel isn't prioritized.
|
// left is extended if the right panel isn't prioritized.
|
||||||
return self.prioritizedExtendedPanel != self.rightPanel;
|
return self.prioritizedExtendedPanel != MFExtendedDrawerRight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +436,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
return NO;
|
return NO;
|
||||||
} else {
|
} else {
|
||||||
// Extend right if the left panel isn't prioritized.
|
// Extend right if the left panel isn't prioritized.
|
||||||
return self.prioritizedExtendedPanel != self.leftPanel;
|
return self.prioritizedExtendedPanel != MFExtendedDrawerLeft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -656,6 +672,98 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)addPanel:(nonnull UIViewController <MVMCoreUIPanelProtocol> *)panel {
|
||||||
|
UIView *view = panel.view;
|
||||||
|
[self addChildViewController:panel];
|
||||||
|
[self.view addSubview:view];
|
||||||
|
[panel didMoveToParentViewController:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removePanel:(nullable UIViewController <MVMCoreUIPanelProtocol> *)panel {
|
||||||
|
[panel willMoveToParentViewController:nil];
|
||||||
|
[panel.view removeFromSuperview];
|
||||||
|
[panel removeFromParentViewController];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupLeftPanel {
|
||||||
|
UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
|
||||||
|
UIViewController *currentViewController = [self getCurrentDetailViewController];
|
||||||
|
if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) {
|
||||||
|
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel];
|
||||||
|
} else {
|
||||||
|
panel = self.globalLeftPanel;
|
||||||
|
self.leftPanelButton = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!panel) {
|
||||||
|
[self removePanel:self.leftPanel];
|
||||||
|
} else if (panel && panel != self.leftPanel) {
|
||||||
|
[self removePanel:self.leftPanel];
|
||||||
|
[self addPanel:panel];
|
||||||
|
self.leftView = panel.view;
|
||||||
|
self.leftPanel = panel;
|
||||||
|
self.leftView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
NSLayoutConstraint *leftPanelWidth = [NSLayoutConstraint constraintWithItem:self.leftView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:270];
|
||||||
|
self.leftView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
leftPanelWidth.active = YES;
|
||||||
|
self.leftPanelWidth = leftPanelWidth;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.mainView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.leftView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0].active = YES;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.leftView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.leftView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
||||||
|
|
||||||
|
if ([panel respondsToSelector:@selector(buttonForPanel)]) {
|
||||||
|
self.leftPanelButton = [panel buttonForPanel];
|
||||||
|
} else if ([panel respondsToSelector:@selector(imageForButtonForPanel)]) {
|
||||||
|
self.leftPanelButton = [[UIBarButtonItem alloc] initWithImage:[panel imageForButtonForPanel] style:UIBarButtonItemStylePlain target:self action:@selector(leftPanelButtonPressed:)];
|
||||||
|
} else {
|
||||||
|
self.leftPanelButton = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupRightPanel {
|
||||||
|
UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
|
||||||
|
UIViewController *currentViewController = [self getCurrentDetailViewController];
|
||||||
|
if ([currentViewController respondsToSelector:@selector(overrideRightPanel)]) {
|
||||||
|
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideRightPanel];
|
||||||
|
} else {
|
||||||
|
panel = self.globalRightPanel;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!panel) {
|
||||||
|
[self removePanel:self.rightPanel];
|
||||||
|
self.rightPanelButton = nil;
|
||||||
|
} else if (panel && panel != self.rightPanel) {
|
||||||
|
[self removePanel:self.rightPanel];
|
||||||
|
[self addPanel:panel];
|
||||||
|
self.rightView = panel.view;
|
||||||
|
self.rightPanel = panel;
|
||||||
|
self.rightView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
NSLayoutConstraint *rightPanelWidth = [NSLayoutConstraint constraintWithItem:self.rightView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:270];
|
||||||
|
rightPanelWidth.active = YES;
|
||||||
|
self.rightPanelWidth = rightPanelWidth;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.rightView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.mainView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0].active = YES;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.rightView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
||||||
|
[NSLayoutConstraint constraintWithItem:self.rightView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
||||||
|
|
||||||
|
if ([panel respondsToSelector:@selector(buttonForPanel)]) {
|
||||||
|
self.rightPanelButton = [panel buttonForPanel];
|
||||||
|
} else if ([panel respondsToSelector:@selector(imageForButtonForPanel)]) {
|
||||||
|
self.rightPanelButton = [[UIBarButtonItem alloc] initWithImage:[panel imageForButtonForPanel] style:UIBarButtonItemStylePlain target:self action:@selector(rightPanelButtonPressed:)];
|
||||||
|
} else {
|
||||||
|
self.rightPanelButton = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupPanels {
|
||||||
|
[self forceHideBothDrawers];
|
||||||
|
[self setupLeftPanel];
|
||||||
|
[self setupRightPanel];
|
||||||
|
self.explictlyShowingPanel = nil;
|
||||||
|
[self.view layoutIfNeeded];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Bottom Progress Bar
|
#pragma mark - Bottom Progress Bar
|
||||||
|
|
||||||
- (void)setBottomProgressBarProgress:(float)progress {
|
- (void)setBottomProgressBarProgress:(float)progress {
|
||||||
@ -744,62 +852,16 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
||||||
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
||||||
|
|
||||||
// Left Panel
|
// Create panels
|
||||||
UIViewController <MVMCoreUIPanelProtocol> *leftPanel = [self createLeftPanelViewController];
|
self.globalLeftPanel = [self createLeftPanelViewController];
|
||||||
if (leftPanel) {
|
self.globalRightPanel = [self createRightPanelViewController];
|
||||||
UIView *leftView = leftPanel.view;
|
[self setupPanels];
|
||||||
[self addChildViewController:leftPanel];
|
|
||||||
[self.view addSubview:leftView];
|
|
||||||
[leftPanel didMoveToParentViewController:self];
|
|
||||||
self.leftView = leftView;
|
|
||||||
self.leftPanel = leftPanel;
|
|
||||||
NSLayoutConstraint *leftPanelWidth = [NSLayoutConstraint constraintWithItem:leftView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:270];
|
|
||||||
leftPanelWidth.active = YES;
|
|
||||||
self.leftPanelWidth = leftPanelWidth;
|
|
||||||
[NSLayoutConstraint constraintWithItem:mainView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:leftView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0].active = YES;
|
|
||||||
[NSLayoutConstraint constraintWithItem:leftView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
|
||||||
[NSLayoutConstraint constraintWithItem:leftView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Right Panel
|
|
||||||
UIViewController <MVMCoreUIPanelProtocol> *rightPanel = [self createRightPanelViewController];
|
|
||||||
if (rightPanel) {
|
|
||||||
UIView *rightView = rightPanel.view;
|
|
||||||
[self addChildViewController:rightPanel];
|
|
||||||
[self.view addSubview:rightView];
|
|
||||||
[rightPanel didMoveToParentViewController:self];
|
|
||||||
self.rightView = rightView;
|
|
||||||
self.rightPanel = rightPanel;
|
|
||||||
NSLayoutConstraint *rightPanelWidth = [NSLayoutConstraint constraintWithItem:rightView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:270];
|
|
||||||
rightPanelWidth.active = YES;
|
|
||||||
self.rightPanelWidth = rightPanelWidth;
|
|
||||||
[NSLayoutConstraint constraintWithItem:rightView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0].active = YES;
|
|
||||||
[NSLayoutConstraint constraintWithItem:rightView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
|
||||||
[NSLayoutConstraint constraintWithItem:rightView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self.topAlertView pinATopViewController:self];
|
[self.topAlertView pinATopViewController:self];
|
||||||
|
|
||||||
// Do any additional setup after loading the view.
|
|
||||||
if (self.leftPanel) {
|
|
||||||
if ([self.leftPanel respondsToSelector:@selector(buttonForPanel)]) {
|
|
||||||
self.leftPanelButton = [self.leftPanel buttonForPanel];
|
|
||||||
} else {
|
|
||||||
self.leftPanelButton = [[UIBarButtonItem alloc] initWithImage:[self.leftPanel imageForButtonForPanel] style:UIBarButtonItemStylePlain target:self action:@selector(leftPanelButtonPressed:)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.rightPanel) {
|
|
||||||
if ([self.rightPanel respondsToSelector:@selector(buttonForPanel)]) {
|
|
||||||
self.rightPanelButton = [self.rightPanel buttonForPanel];
|
|
||||||
} else {
|
|
||||||
self.rightPanelButton = [[UIBarButtonItem alloc] initWithImage:[self.rightPanel imageForButtonForPanel] style:UIBarButtonItemStylePlain target:self action:@selector(rightPanelButtonPressed:)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates the back button
|
// Creates the back button
|
||||||
self.backButton = [[UIBarButtonItem alloc] initWithImage:[self imageForBackButton] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)];
|
self.backButton = [[UIBarButtonItem alloc] initWithImage:[self imageForBackButton] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)];
|
||||||
self.backButton.imageInsets = UIEdgeInsetsMake(0, 4, 0, -8);
|
self.backButton.imageInsets = UIEdgeInsetsMake(0, 4, 0, -8);
|
||||||
@ -811,7 +873,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.extendedDrawers = MFExtendedDrawerLeft | MFExtendedDrawerRight;
|
self.extendedDrawers = MFExtendedDrawerLeft | MFExtendedDrawerRight;
|
||||||
self.prioritizedExtendedPanel = self.leftPanel;
|
self.prioritizedExtendedPanel = MFExtendedDrawerLeft;
|
||||||
|
|
||||||
self.view.backgroundColor = [UIColor blackColor];
|
self.view.backgroundColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,6 +160,10 @@ B3 -> Legal
|
|||||||
//55Rg 16pt for 5G flow
|
//55Rg 16pt for 5G flow
|
||||||
+ (nullable UIFont *)font5GMessage:(BOOL)genericScaling;
|
+ (nullable UIFont *)font5GMessage:(BOOL)genericScaling;
|
||||||
|
|
||||||
|
//55Rg 16pt for 5G flow scale YES
|
||||||
|
+ (nullable UIFont *)font5GMessage;
|
||||||
|
|
||||||
|
|
||||||
// Returns the fonts for these styles allowing to apply a generic scale by device or not.
|
// Returns the fonts for these styles allowing to apply a generic scale by device or not.
|
||||||
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling;
|
||||||
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling;
|
+ (nullable UIFont *)fontForPlan:(BOOL)genericScaling;
|
||||||
|
|||||||
@ -355,6 +355,10 @@ CGFloat const LabelWithInternalButtonLineSpace = 2;
|
|||||||
return [MFFonts mfFont55Rg:size];
|
return [MFFonts mfFont55Rg:size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nullable UIFont *)font5GMessage {
|
||||||
|
return [self font5GMessage:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
+ (nullable UIFont *)fontForHeadlineAlternative:(BOOL)genericScaling {
|
+ (nullable UIFont *)fontForHeadlineAlternative:(BOOL)genericScaling {
|
||||||
CGFloat size = 24;
|
CGFloat size = 24;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user