diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift index 122adcee..5e998a53 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift @@ -14,4 +14,6 @@ public protocol PageModelProtocol { var backgroundColor: Color? { get set } var navigationBar: (NavigationItemModelProtocol & MoleculeModelProtocol)? { get set } var shouldMaskScreenWhileRecording: Bool? { get } + var hideLeftPanel: Bool? { get } + var hideRightPanel: Bool? { get } } diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index ee6a0a77..b5c4763c 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -32,6 +32,8 @@ import Foundation public var tabBarIndex: Int? public var shouldMaskScreenWhileRecording: Bool? + public var hideLeftPanel: Bool? + public var hideRightPanel: Bool? public func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> Bool { return try replaceChildMolecule(at: &navigationBar, with: molecule) @@ -60,6 +62,8 @@ import Foundation case tabBarHidden case tabBarIndex case shouldMaskScreenWhileRecording + case hideLeftPanel + case hideRightPanel } //-------------------------------------------------- @@ -83,6 +87,12 @@ import Foundation if let tabBarHidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .tabBarHidden) { self.tabBarHidden = tabBarHidden } + if let hideLeftPanel = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideLeftPanel) { + self.hideLeftPanel = hideLeftPanel + } + if let hideRightPanel = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideRightPanel) { + self.hideRightPanel = hideRightPanel + } tabBarIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .tabBarIndex) shouldMaskScreenWhileRecording = try typeContainer.decodeIfPresent(Bool.self, forKey: .shouldMaskScreenWhileRecording) } @@ -96,6 +106,8 @@ import Foundation try container.encodeIfPresent(formRules, forKey: .formRules) try container.encodeModelIfPresent(navigationBar, forKey: .navigationBar) try container.encode(tabBarHidden, forKey: .tabBarHidden) + try container.encode(hideLeftPanel, forKey: .hideLeftPanel) + try container.encode(hideRightPanel, forKey: .hideRightPanel) try container.encodeIfPresent(tabBarIndex, forKey: .tabBarIndex) try container.encode(shouldMaskScreenWhileRecording, forKey: .shouldMaskScreenWhileRecording) } diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 878c486c..5997847d 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -559,7 +559,7 @@ import MVMCore public func isRightPanelAccessible() -> Bool { // TODO: Remove when FAB is 100%. - if loadObject?.pageJSON?.boolForKey(KeyHideMainMenu) ?? false { + if let hideRightPanel = model?.hideRightPanel, hideRightPanel == true { return false } return (MVMCoreUISession.sharedGlobal()?.launchAppLoadedSuccessfully ?? false) || showRightPanelForScreenBeforeLaunchApp()