Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui.git into feature/atomic_vds_buttonGroup
This commit is contained in:
commit
fb459cfdd5
@ -31,6 +31,8 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
||||
public var size: VDS.Button.Size = .large
|
||||
public var groupName: String = ""
|
||||
public var inverted: Bool = false
|
||||
public var accessibilityTraits: UIAccessibilityTraits?
|
||||
public var disabledAccessibilityTraits: UIAccessibilityTraits?
|
||||
public var backgroundColor: Color?
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -77,6 +79,8 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
||||
case size
|
||||
case groupName
|
||||
case width
|
||||
case accessibilityTraits
|
||||
case disabledAccessibilityTraits
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -118,6 +122,10 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
||||
} else {
|
||||
try setInverted(deprecatedFrom: decoder)
|
||||
}
|
||||
|
||||
accessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .accessibilityTraits)
|
||||
|
||||
disabledAccessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .disabledAccessibilityTraits)
|
||||
}
|
||||
|
||||
private enum DeprecatedCodingKeys: String, CodingKey {
|
||||
@ -158,6 +166,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
||||
self.inverted = !backgroundColor.uiColor.isDark()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open func encode(to encoder: Encoder) throws {
|
||||
@ -174,5 +183,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat
|
||||
try container.encode(size, forKey: .size)
|
||||
try container.encodeIfPresent(groupName, forKey: .groupName)
|
||||
try container.encodeIfPresent(width, forKey: .width)
|
||||
try container.encodeIfPresent(accessibilityTraits, forKey: .accessibilityTraits)
|
||||
try container.encodeIfPresent(disabledAccessibilityTraits, forKey: .disabledAccessibilityTraits)
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ import Foundation
|
||||
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
FormValidator.setupValidation(for: castModel, delegate: delegateObject?.formHolderDelegate)
|
||||
|
||||
}
|
||||
|
||||
public func setState() {
|
||||
@ -47,6 +46,9 @@ import Foundation
|
||||
} else if let disabledTintColor = castModel.disabledTintColor {
|
||||
image.imageView.tintColor = disabledTintColor.uiColor
|
||||
}
|
||||
if let traits = model?.accessibilityTraits {
|
||||
accessibilityTraits = traits
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
|
||||
public var enabled: Bool = true
|
||||
public var enabledTintColor: Color?
|
||||
public var disabledTintColor: Color?
|
||||
|
||||
public var accessibilityTraits: UIAccessibilityTraits?
|
||||
public var groupName: String = ""
|
||||
|
||||
public var updateUI: ActionBlock?
|
||||
@ -45,6 +45,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
|
||||
case groupName
|
||||
case enabledTintColor
|
||||
case disabledTintColor
|
||||
case accessibilityTraits
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -59,7 +60,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
|
||||
image = try typeContainer.decodeIfPresent(ImageViewModel.self, forKey: .image)
|
||||
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||
action = try typeContainer.decodeModel(codingKey: .action)
|
||||
|
||||
accessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .accessibilityTraits) ?? .button
|
||||
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
||||
self.enabled = enabled
|
||||
}
|
||||
@ -90,5 +91,6 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
|
||||
try container.encodeIfPresent(groupName, forKey: .groupName)
|
||||
try container.encodeIfPresent(enabledTintColor, forKey: .enabledTintColor)
|
||||
try container.encodeIfPresent(disabledTintColor, forKey: .disabledTintColor)
|
||||
try container.encodeIfPresent(accessibilityTraits, forKey: .accessibilityTraits)
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,9 @@ open class PillButton: VDS.Button, MVMCoreUIViewConstrainingProtocol, MFButtonPr
|
||||
if let accessibilityText = viewModel.accessibilityText {
|
||||
accessibilityLabel = accessibilityText
|
||||
}
|
||||
|
||||
|
||||
accessibilityTraits = isEnabled ? (viewModel?.accessibilityTraits ?? .button) : (viewModel?.disabledAccessibilityTraits ?? .none)
|
||||
|
||||
set(with: viewModel.action, delegateObject: delegateObject, additionalData: additionalData)
|
||||
|
||||
viewModel.updateUI = { [weak self] in
|
||||
@ -58,8 +60,10 @@ open class PillButton: VDS.Button, MVMCoreUIViewConstrainingProtocol, MFButtonPr
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
|
||||
open class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return (model as? ButtonModel)?.size.height
|
||||
|
||||
}
|
||||
|
||||
open func updateView(_ size: CGFloat) {}
|
||||
|
||||
@ -161,7 +161,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
||||
bottomConstraint?.isActive = true
|
||||
|
||||
heightConstraint = textView.heightAnchor.constraint(equalToConstant: 0)
|
||||
accessibilityElements = [titleLabel, textView, feedbackLabel]
|
||||
accessibilityElements = [textView]
|
||||
}
|
||||
|
||||
open override func updateView(_ size: CGFloat) {
|
||||
@ -281,6 +281,25 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
||||
if model.hideBorders {
|
||||
adjustMarginConstraints(constant: 0)
|
||||
}
|
||||
updateAccessibility(model: model)
|
||||
}
|
||||
|
||||
func updateAccessibility(model: TextViewEntryFieldModel) {
|
||||
|
||||
var message = ""
|
||||
|
||||
if let titleText = model.accessibilityText ?? model.title {
|
||||
message += "\(titleText) \( model.enabled ? String(format: (MVMCoreUIUtility.hardcodedString(withKey: "textfield_optional")) ?? "") : "" ) \(self.textView.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")"
|
||||
}
|
||||
|
||||
if let feedback = model.feedback {
|
||||
message += ", " + feedback
|
||||
}
|
||||
|
||||
if let errorMessage = errorLabel.text {
|
||||
message += ", " + errorMessage
|
||||
}
|
||||
|
||||
textView.accessibilityLabel = message
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ import Foundation
|
||||
// MARK: - Lifecycle
|
||||
//--------------------------------------------------
|
||||
|
||||
public func setupView() {
|
||||
open func setupView() {
|
||||
|
||||
clipsToBounds = true
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
@ -70,7 +70,7 @@ import Foundation
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
|
||||
guard let progressBarModel = model as? ProgressBarModel else { return }
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ProgressBarModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "progressBar"
|
||||
@objcMembers open class ProgressBarModel: MoleculeModelProtocol {
|
||||
open class var identifier: String { "progressBar" }
|
||||
public var id: String = UUID().uuidString
|
||||
|
||||
@Percent public var percent: CGFloat
|
||||
@ -46,7 +46,7 @@ import Foundation
|
||||
thickness = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .thickness)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
open func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(id, forKey: .id)
|
||||
try container.encode(moleculeName, forKey: .moleculeName)
|
||||
|
||||
@ -75,6 +75,7 @@ import Foundation
|
||||
delegateObject, additionalData)
|
||||
rightImageView.set(with: model.image, delegateObject, additionalData)
|
||||
updateAccessibilityLabel()
|
||||
accessibilityTraits.update(with: model.accessibilityTraits ?? button.accessibilityTraits)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
|
||||
@ -73,6 +73,7 @@
|
||||
delegateObject, additionalData)
|
||||
rightImageView.set(with: model.image, delegateObject, additionalData)
|
||||
updateAccessibilityLabel()
|
||||
accessibilityTraits.update(with: model.accessibilityTraits ?? button.accessibilityTraits)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
|
||||
let linkShowing = (model as? ListLeftVariableIconAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((isAccessibilityElement && accessoryView != nil) ? .button : .none)
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
|
||||
@ -91,6 +91,6 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
func updateAccessibilityLabel() {
|
||||
let linkShowing = (model as? ListLeftVariableIconWithRightCaretAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((isAccessibilityElement && accessoryView != nil) ? .button : .none)
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
|
||||
@ -109,6 +109,6 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
|
||||
let linkShowing = (model as? ListLeftVariableNumberedListAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((isAccessibilityElement && accessoryView != nil) ? .button : .none)
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -134,6 +134,6 @@ open class ListProgressBarThin: TableViewCell {
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,11 +70,7 @@
|
||||
|
||||
override public var accessibilityTraits: UIAccessibilityTraits {
|
||||
get {
|
||||
if (accessoryView != nil) {
|
||||
return .button
|
||||
} else {
|
||||
return .none
|
||||
}
|
||||
return (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
@ -97,7 +97,8 @@ import Foundation
|
||||
// Ensures voice over does not read "selected" after user triggers action on cell.
|
||||
override public var accessibilityTraits: UIAccessibilityTraits {
|
||||
get {
|
||||
return (accessoryView != nil) ? .button : .none
|
||||
return (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
|
||||
}
|
||||
set {}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ import Foundation
|
||||
/// Ensures voice over does not read "selected" after user triggers action on cell.
|
||||
override public var accessibilityTraits: UIAccessibilityTraits {
|
||||
get {
|
||||
return (accessoryView != nil) ? .button : .none
|
||||
return (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
set {}
|
||||
}
|
||||
|
||||
@ -91,6 +91,6 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
stack.restack()
|
||||
accessibilityValue = button.accessibilityValue
|
||||
accessibilityHint = button.accessibilityHint
|
||||
accessibilityTraits = .button
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits ?? .button)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -83,6 +83,6 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
|
||||
let linkShowing = (model as? ListRightVariablePriceChangeAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((isAccessibilityElement && accessoryView != nil) ? .button : .none)
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
|
||||
@ -98,6 +98,6 @@
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,8 +99,8 @@
|
||||
|
||||
let linkShowing = (model as? ListRightVariableRightCaretAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((isAccessibilityElement && accessoryView != nil) ? .button : .none)
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
accessibilityLabel = getAccessibilityMessage()
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
accessibilityTraits = .button
|
||||
accessibilityTraits = listItemModel?.accessibilityTraits ?? .button
|
||||
|
||||
if !linkShowing && accessoryView == nil {
|
||||
// Make whole cell focusable if one action
|
||||
|
||||
@ -103,6 +103,6 @@ open class ListRightVariableTotalData: TableViewCell {
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (listItemModel?.accessibilityTraits) ?? ((accessoryView != nil) ? .button : .none)
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,9 @@
|
||||
public var hideArrow: Bool?
|
||||
public var line: LineModel?
|
||||
public var style: ListItemStyle?
|
||||
public var accessibilityTraits: UIAccessibilityTraits?
|
||||
public var accessibilityValue: String?
|
||||
public var accessibilityText: String?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
@ -30,6 +31,8 @@
|
||||
case hideArrow
|
||||
case line
|
||||
case style
|
||||
case accessibilityTraits
|
||||
case accessibilityValue
|
||||
case accessibilityText
|
||||
}
|
||||
|
||||
@ -104,7 +107,8 @@
|
||||
hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow)
|
||||
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
|
||||
style = try typeContainer.decodeIfPresent(ListItemStyle.self, forKey: .style)
|
||||
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||
accessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .accessibilityTraits)
|
||||
accessibilityValue = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityValue)
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
|
||||
@ -116,6 +120,8 @@
|
||||
try container.encodeIfPresent(hideArrow, forKey: .hideArrow)
|
||||
try container.encodeIfPresent(line, forKey: .line)
|
||||
try container.encodeIfPresent(style, forKey: .style)
|
||||
try container.encodeIfPresent(accessibilityTraits, forKey: .accessibilityTraits)
|
||||
try container.encodeIfPresent(accessibilityValue, forKey: .accessibilityValue)
|
||||
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ public protocol AccessibilityModelProtocol {
|
||||
var accessibilityTraits: UIAccessibilityTraits? { get set }
|
||||
var accessibilityText: String? { get set }
|
||||
var accessibilityValue: String? { get set }
|
||||
var accessibilityHint: String? { get set }
|
||||
}
|
||||
|
||||
public extension AccessibilityModelProtocol {
|
||||
@ -38,4 +39,9 @@ public extension AccessibilityModelProtocol {
|
||||
get { nil }
|
||||
set { }
|
||||
}
|
||||
|
||||
var accessibilityHint: String? {
|
||||
get { nil }
|
||||
set {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ public enum ListItemStyle: String, Codable {
|
||||
case none
|
||||
}
|
||||
|
||||
public protocol ListItemModelProtocol: ContainerModelProtocol {
|
||||
public protocol ListItemModelProtocol: ContainerModelProtocol, AccessibilityModelProtocol {
|
||||
var line: LineModel? { get set }
|
||||
var action: ActionModelProtocol? { get set }
|
||||
var hideArrow: Bool? { get set }
|
||||
|
||||
@ -163,6 +163,15 @@ import UIKit
|
||||
|
||||
// align if needed.
|
||||
containerHelper.set(with: model, for: molecule as? MVMCoreUIViewConstrainingProtocol)
|
||||
|
||||
if let traits = model.accessibilityTraits {
|
||||
accessibilityTraits.update(with: traits)
|
||||
}
|
||||
if let accessibilityText = model.accessibilityText {
|
||||
accessibilityLabel = accessibilityText
|
||||
isAccessibilityElement = true
|
||||
}
|
||||
accessibilityValue = model.accessibilityValue
|
||||
}
|
||||
|
||||
open func reset() {
|
||||
|
||||
@ -98,7 +98,6 @@ import UIKit
|
||||
smartInsertDeleteType = .no
|
||||
inputAccessoryView = nil
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .staticText
|
||||
font = fontStyle.getFont()
|
||||
keyboardType = .default
|
||||
isEditable = true
|
||||
|
||||
@ -83,7 +83,6 @@ import Combine
|
||||
}
|
||||
|
||||
extension NavigationController: MVMCoreViewManagerProtocol {
|
||||
|
||||
public func getAccessibilityElements() -> [Any]? {
|
||||
nil
|
||||
}
|
||||
|
||||
@ -249,7 +249,6 @@ public extension MVMCoreUISplitViewController {
|
||||
}
|
||||
|
||||
extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
|
||||
|
||||
public func getAccessibilityElements() -> [Any]? {
|
||||
nil
|
||||
}
|
||||
@ -263,7 +262,7 @@ extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
|
||||
}
|
||||
|
||||
public func willDisplay(_ viewController: UIViewController) {
|
||||
setupPanels()
|
||||
setupPanels(viewController)
|
||||
updateState(with: viewController)
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
||||
- (void)setNavigationIconColor:(nullable UIColor *)color;
|
||||
|
||||
/// 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)
|
||||
- (BOOL)leftPanelStaysExtended;
|
||||
|
||||
@ -723,9 +723,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
||||
[panel removeFromParentViewController];
|
||||
}
|
||||
|
||||
- (void)setupLeftPanel {
|
||||
- (void)setupLeftPanel:(nullable UIViewController*)viewController {
|
||||
UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
|
||||
UIViewController *currentViewController = [self getCurrentDetailViewController];
|
||||
UIViewController *currentViewController = viewController ? viewController : [self getCurrentDetailViewController];
|
||||
if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) {
|
||||
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel];
|
||||
} else {
|
||||
@ -735,6 +735,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
||||
|
||||
if (!panel) {
|
||||
[self removePanel:self.leftPanel];
|
||||
self.leftPanel = nil;
|
||||
} else if (panel && panel != self.leftPanel) {
|
||||
[self removePanel:self.leftPanel];
|
||||
[self addPanel:panel];
|
||||
@ -795,9 +796,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setupPanels {
|
||||
- (void)setupPanels:(nullable UIViewController*)viewController {
|
||||
[self forceHideBothDrawers];
|
||||
[self setupLeftPanel];
|
||||
[self setupLeftPanel:viewController];
|
||||
[self setupRightPanel];
|
||||
self.explictlyShowingPanel = nil;
|
||||
[self.view layoutIfNeeded];
|
||||
@ -968,7 +969,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:self.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:coverView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
||||
|
||||
[self setupPanels];
|
||||
[self setupPanels:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
// MARK: Textfield
|
||||
"textfield_today_string" = "Today";
|
||||
"textfield_error_message" = "%@.\n The error message.\n %@";
|
||||
"textView_error_message" = "%@.\n The error message.\n %@";
|
||||
"textfield_picker_item" = " picker item";
|
||||
"textfield_regular" = " regular";
|
||||
"textfield_disabled_state" = "disabled";
|
||||
@ -62,7 +63,7 @@
|
||||
|
||||
// MARK: Switch / Toggle
|
||||
"mfswitch_buttonlabel" = "Switch Button";
|
||||
"Toggle_buttonlabel" = "Toggle Button";
|
||||
"Toggle_buttonlabel" = "Toggle";
|
||||
"AccOn" = "on";
|
||||
"AccOff" = "off";
|
||||
"AccToggleHint" = "double tap to toggle";
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
// Textfield
|
||||
"textfield_today_string" = "Hoy";
|
||||
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||
"textView_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||
"textfield_picker_item" = " artículo de selector";
|
||||
"textfield_regular" = " regular";
|
||||
"textfield_disabled_state" = "inactivo";
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
// Textfield
|
||||
"textfield_today_string" = "Hoy";
|
||||
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||
"textView_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||
"textfield_picker_item" = " artículo de selector";
|
||||
"textfield_regular" = " regular";
|
||||
"textfield_disabled_state" = "inactivo";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user