Merge branch 'develop' into feature/Headers_H1_LandingPageHeader

This commit is contained in:
Lekshmi S 2020-06-18 11:46:03 +05:30
commit c8ac64e432
19 changed files with 17 additions and 20 deletions

View File

@ -37,6 +37,8 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
override open func setupView() { override open func setupView() {
super.setupView() super.setupView()
leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical)
leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal)
addMolecule(stack) addMolecule(stack)
stack.restack() stack.restack()
@ -65,12 +67,6 @@ import Foundation
leftLabel.setFontStyle(.Title2XLarge) leftLabel.setFontStyle(.Title2XLarge)
} }
open override func layoutSubviews() {
super.layoutSubviews()
// This fixes a defect body text where it doesn't layout correctly.
eyebrowHeadlineBodyLink.body.preferredMaxLayoutWidth = eyebrowHeadlineBodyLink.frame.width
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Accessibility // MARK: - Accessibility
//-------------------------------------------------- //--------------------------------------------------

View File

@ -56,7 +56,7 @@ import Foundation
// Add buttons // Add buttons
var tabs: [UITabBarItem] = [] var tabs: [UITabBarItem] = []
for (index, tab) in model.tabs.enumerated() { for (index, tab) in model.tabs.enumerated() {
let tabBarItem = UITabBarItem(title: tab.title, image: UIImage(named: tab.image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil), tag: index) let tabBarItem = UITabBarItem(title: tab.title, image: MVMCoreCache.shared()?.getImageFromRegisteredBundles(tab.image), tag: index)
tabs.append(tabBarItem) tabs.append(tabBarItem)
} }
setItems(tabs, animated: false) setItems(tabs, animated: false)

View File

@ -38,7 +38,7 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule
/// Convenience function that creates a BarButtonItem for the model. /// Convenience function that creates a BarButtonItem for the model.
public func createNavigationItemButton(delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> UIBarButtonItem { public func createNavigationItemButton(delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> UIBarButtonItem {
let imageName = UIImage(named: image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) let uiImage = MVMCoreCache.shared()?.getImageFromRegisteredBundles(image)
return ImageBarButtonItem.create(with: imageName, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) return ImageBarButtonItem.create(with: uiImage, actionModel: action, delegateObject: delegateObject, additionalData: additionalData)
} }
} }

View File

@ -237,12 +237,12 @@ CGFloat const PanelAnimationDuration = 0.2;
- (void)setLeftNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { - (void)setLeftNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended {
NSMutableArray *leftBarButtonItems = [NSMutableArray array]; NSMutableArray *leftBarButtonItems = [NSMutableArray array];
NSArray *extraButtons = [self additionalLeftButtonsForViewController:viewController]; NSArray *extraButtons = [self additionalLeftButtonsForViewController:viewController];
if (extraButtons) {
[leftBarButtonItems addObjectsFromArray:extraButtons];
}
if ((accessible && !extended) && self.leftPanelButton && ![extraButtons containsObject:self.leftPanelButton]) { if ((accessible && !extended) && self.leftPanelButton && ![extraButtons containsObject:self.leftPanelButton]) {
[leftBarButtonItems addObject:self.leftPanelButton]; [leftBarButtonItems addObject:self.leftPanelButton];
} }
if (extraButtons) {
[leftBarButtonItems addObjectsFromArray:extraButtons];
}
[viewController.navigationItem setLeftBarButtonItems:(leftBarButtonItems.count > 0 ? leftBarButtonItems : nil) animated:!DisableAnimations]; [viewController.navigationItem setLeftBarButtonItems:(leftBarButtonItems.count > 0 ? leftBarButtonItems : nil) animated:!DisableAnimations];
} }
@ -918,7 +918,7 @@ CGFloat const PanelAnimationDuration = 0.2;
self.extendedDrawers = MFExtendedDrawerLeft | MFExtendedDrawerRight; self.extendedDrawers = MFExtendedDrawerLeft | MFExtendedDrawerRight;
self.prioritizedExtendedPanel = MFExtendedDrawerLeft; self.prioritizedExtendedPanel = MFExtendedDrawerLeft;
self.view.backgroundColor = [UIColor blackColor]; self.view.backgroundColor = [UIColor whiteColor];
} }
- (void)viewDidLayoutSubviews { - (void)viewDidLayoutSubviews {
@ -1069,6 +1069,7 @@ CGFloat const PanelAnimationDuration = 0.2;
if ([self.rightPanelButton respondsToSelector:@selector(setIconColor:)]) { if ([self.rightPanelButton respondsToSelector:@selector(setIconColor:)]) {
[((UIBarButtonItem <MVMCoreUIPanelButtonProtocol>*)self.rightPanelButton) setIconColor:color]; [((UIBarButtonItem <MVMCoreUIPanelButtonProtocol>*)self.rightPanelButton) setIconColor:color];
} }
[self.backButton setTintColor:color];
} }
@end @end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

View File

@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "back.png", "filename" : "nav_back.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "back@2x.png", "filename" : "nav_back@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "back@3x.png", "filename" : "nav_back@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "closeXBlack.png", "filename" : "nav_close.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "closeXBlack@2x.png", "filename" : "nav_close@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "closeXBlack@3x.png", "filename" : "nav_close@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

View File

@ -13,7 +13,7 @@ public extension MVMCoreUICommonViewsUtility {
/// Add the close button (x) to the top right of the view. TODO: update this logic. /// Add the close button (x) to the top right of the view. TODO: update this logic.
@objc static func addCloseButton(to view: UIView, action: @escaping ButtonAction, centeredVertically: Bool = false) -> Button { @objc static func addCloseButton(to view: UIView, action: @escaping ButtonAction, centeredVertically: Bool = false) -> Button {
let button = Button() let button = Button()
if let image = MVMCoreUIUtility.imageNamed("closeXBlack")?.withRenderingMode(.alwaysTemplate) { if let image = MVMCoreUIUtility.imageNamed("nav_close")?.withRenderingMode(.alwaysTemplate) {
button.setImage(image, for: .normal) button.setImage(image, for: .normal)
} }
button.tintColor = .black button.tintColor = .black