Hamberg menu fix

This commit is contained in:
Sureshkumar Ramachandran 2023-12-08 14:42:50 +05:30
parent 9ec376ffa9
commit 9f2a1cb6d1
3 changed files with 7 additions and 7 deletions

View File

@ -263,7 +263,7 @@ extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
} }
public func willDisplay(_ viewController: UIViewController) { public func willDisplay(_ viewController: UIViewController) {
setupPanels() setupPanels(viewController)
updateState(with: viewController) updateState(with: viewController)
} }

View File

@ -99,7 +99,7 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
- (void)setNavigationIconColor:(nullable UIColor *)color; - (void)setNavigationIconColor:(nullable UIColor *)color;
/// Updates the panels that are used. /// Updates the panels that are used.
- (void)setupPanels; - (void)setupPanels:(nullable UIViewController*)viewController;
/// Returns if the left panel is staying extended (usually do to screen size threshold) /// Returns if the left panel is staying extended (usually do to screen size threshold)
- (BOOL)leftPanelStaysExtended; - (BOOL)leftPanelStaysExtended;

View File

@ -723,9 +723,9 @@ CGFloat const PanelAnimationDuration = 0.2;
[panel removeFromParentViewController]; [panel removeFromParentViewController];
} }
- (void)setupLeftPanel { - (void)setupLeftPanel:(nullable UIViewController*)viewController {
UIViewController <MVMCoreUIPanelProtocol> *panel = nil; UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
UIViewController *currentViewController = [self getCurrentDetailViewController]; UIViewController *currentViewController = viewController ? viewController : [self getCurrentDetailViewController];
if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) { if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) {
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel]; panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel];
} else { } else {
@ -795,9 +795,9 @@ CGFloat const PanelAnimationDuration = 0.2;
} }
} }
- (void)setupPanels { - (void)setupPanels:(nullable UIViewController*)viewController {
[self forceHideBothDrawers]; [self forceHideBothDrawers];
[self setupLeftPanel]; [self setupLeftPanel:viewController];
[self setupRightPanel]; [self setupRightPanel];
self.explictlyShowingPanel = nil; self.explictlyShowingPanel = nil;
[self.view layoutIfNeeded]; [self.view layoutIfNeeded];
@ -968,7 +968,7 @@ CGFloat const PanelAnimationDuration = 0.2;
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES; [NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
[NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:coverView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES; [NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:coverView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
[self setupPanels]; [self setupPanels:nil];
} }
- (void)viewDidLoad { - (void)viewDidLoad {