Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui.git into test
This commit is contained in:
commit
f96b750302
@ -33,6 +33,9 @@
|
|||||||
- (void)showArrow;
|
- (void)showArrow;
|
||||||
- (void)hideArrow;
|
- (void)hideArrow;
|
||||||
|
|
||||||
|
/// Orientation supported by the panel.
|
||||||
|
- (UIInterfaceOrientationMask)supportedInterface;
|
||||||
|
|
||||||
/// The width to use if the panel is automatically extended when the screen is big enough.
|
/// The width to use if the panel is automatically extended when the screen is big enough.
|
||||||
- (CGFloat)panelExtendedWidth;
|
- (CGFloat)panelExtendedWidth;
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,13 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
|||||||
|
|
||||||
@property (nullable, strong, nonatomic) NSSet *cancellables;
|
@property (nullable, strong, nonatomic) NSSet *cancellables;
|
||||||
|
|
||||||
|
/// When set to true, the panel will always be full width of the split.
|
||||||
|
@property (nonatomic) BOOL leftPanelFullWidth;
|
||||||
|
|
||||||
|
/// When set to true, the panel will always be full width of the split.
|
||||||
|
@property (nonatomic) BOOL rightPanelFullWidth;
|
||||||
|
|
||||||
|
|
||||||
// Convenience getter
|
// Convenience getter
|
||||||
+ (nullable instancetype)mainSplitViewController;
|
+ (nullable instancetype)mainSplitViewController;
|
||||||
|
|
||||||
@ -131,6 +138,8 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
|||||||
|
|
||||||
/// Returns true if a panel is showing.
|
/// Returns true if a panel is showing.
|
||||||
- (BOOL)isAPanelShowing;
|
- (BOOL)isAPanelShowing;
|
||||||
|
- (BOOL)isLeftPanelShowing;
|
||||||
|
- (BOOL)isRightPanelShowing;
|
||||||
|
|
||||||
#pragma mark - Main Subclassables
|
#pragma mark - Main Subclassables
|
||||||
|
|
||||||
|
|||||||
@ -679,6 +679,11 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
[protocolController panelDidAppear:panel];
|
[protocolController panelDidAppear:panel];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (@available(iOS 16.0, *)) {
|
||||||
|
if ([panel respondsToSelector:@selector(supportedInterface)]) {
|
||||||
|
[controller setNeedsUpdateOfSupportedInterfaceOrientations];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)panelWillDisappear:(UIViewController <MVMCoreUIPanelProtocol> *)panel animated:(BOOL)animated {
|
- (void)panelWillDisappear:(UIViewController <MVMCoreUIPanelProtocol> *)panel animated:(BOOL)animated {
|
||||||
@ -709,6 +714,11 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
[protocolController panelDidDisappear:panel];
|
[protocolController panelDidDisappear:panel];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (@available(iOS 16.0, *)) {
|
||||||
|
if ([panel respondsToSelector:@selector(supportedInterface)]) {
|
||||||
|
[controller setNeedsUpdateOfSupportedInterfaceOrientations];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addPanel:(nonnull UIViewController <MVMCoreUIPanelProtocol> *)panel {
|
- (void)addPanel:(nonnull UIViewController <MVMCoreUIPanelProtocol> *)panel {
|
||||||
@ -999,7 +1009,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
CGFloat leftPanelExtendedWidth = [self leftPanelExtendedWidth];
|
CGFloat leftPanelExtendedWidth = [self leftPanelExtendedWidth];
|
||||||
CGFloat leftPanelMaxWidth = [self leftPanelMaxWidth];
|
CGFloat leftPanelMaxWidth = [self leftPanelMaxWidth];
|
||||||
if ([self shouldExtendLeftPanel:numberOfDrawers] && viewWidth > leftPanelExtendedWidth) {
|
if (self.leftPanelFullWidth) {
|
||||||
|
self.leftPanelWidth.constant = viewWidth;
|
||||||
|
} else if ([self shouldExtendLeftPanel:numberOfDrawers] && viewWidth > leftPanelExtendedWidth) {
|
||||||
self.leftPanelWidth.constant = leftPanelExtendedWidth;
|
self.leftPanelWidth.constant = leftPanelExtendedWidth;
|
||||||
} else if (viewWidth > leftPanelMaxWidth) {
|
} else if (viewWidth > leftPanelMaxWidth) {
|
||||||
self.leftPanelWidth.constant = leftPanelMaxWidth;
|
self.leftPanelWidth.constant = leftPanelMaxWidth;
|
||||||
@ -1009,7 +1021,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
CGFloat rightPanelExtendedWidth = [self rightPanelExtendedWidth];
|
CGFloat rightPanelExtendedWidth = [self rightPanelExtendedWidth];
|
||||||
CGFloat rightPanelMaxWidth = [self rightPanelMaxWidth];
|
CGFloat rightPanelMaxWidth = [self rightPanelMaxWidth];
|
||||||
if ([self shouldExtendRightPanel:numberOfDrawers] && viewWidth > rightPanelExtendedWidth) {
|
if (self.rightPanelFullWidth) {
|
||||||
|
self.rightPanelWidth.constant = viewWidth;
|
||||||
|
} else if ([self shouldExtendRightPanel:numberOfDrawers] && viewWidth > rightPanelExtendedWidth) {
|
||||||
self.rightPanelWidth.constant = rightPanelExtendedWidth;
|
self.rightPanelWidth.constant = rightPanelExtendedWidth;
|
||||||
} else if (viewWidth > rightPanelMaxWidth) {
|
} else if (viewWidth > rightPanelMaxWidth) {
|
||||||
self.rightPanelWidth.constant = rightPanelMaxWidth;
|
self.rightPanelWidth.constant = rightPanelMaxWidth;
|
||||||
@ -1063,6 +1077,14 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
return fabs(self.mainViewLeading.constant) > 1;
|
return fabs(self.mainViewLeading.constant) > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isLeftPanelShowing {
|
||||||
|
return !self.leftView.isHidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isRightPanelShowing {
|
||||||
|
return !self.rightView.isHidden;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Getters
|
#pragma mark - Getters
|
||||||
|
|
||||||
// Returns the desired view or falls back. Hot fix until we can get away from using these functions...
|
// Returns the desired view or falls back. Hot fix until we can get away from using these functions...
|
||||||
|
|||||||
@ -102,4 +102,22 @@ public extension MVMCoreUIUtility {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOS 16.0, *)
|
||||||
|
@objc @MainActor
|
||||||
|
static func setNeedsUpdateOfSupportedInterfaceOrientations() {
|
||||||
|
var viewController = NavigationHandler.shared().getViewControllerToPresentOn()
|
||||||
|
while let presentedController = viewController?.presentedViewController,
|
||||||
|
!presentedController.isBeingDismissed {
|
||||||
|
viewController = presentedController
|
||||||
|
}
|
||||||
|
if let navigationController = viewController as? UINavigationController {
|
||||||
|
viewController = navigationController.topViewController
|
||||||
|
}
|
||||||
|
if let viewController = viewController {
|
||||||
|
viewController.setNeedsUpdateOfSupportedInterfaceOrientations()
|
||||||
|
} else if let viewController = MVMCoreUISession.sharedGlobal()?.navigationController?.topViewController {
|
||||||
|
viewController.setNeedsUpdateOfSupportedInterfaceOrientations()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user