From 2fafde090e2e76d5595f398392007698b4989c87 Mon Sep 17 00:00:00 2001 From: "Christiano, Kevin" Date: Mon, 29 Apr 2019 16:55:22 -0400 Subject: [PATCH 01/13] matching change from release. --- MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift index ca314365..502c766a 100644 --- a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift +++ b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift @@ -604,8 +604,8 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt performAction = wButtonDelegate.button?(wSelf, shouldPerformActionWithMap: actionMap, additionalData: additionalData) ?? false } - if let wDelegate = weakDelegate as? CoreObjectActionLoadPresentDelegate, performAction { - MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: additionalData, delegate: wDelegate) + if performAction { + MVMCoreActionHandler.shared()?.handleAction(with: actionMap, additionalData: additionalData, delegate: weakDelegate as? CoreObjectActionLoadPresentDelegate) } } } From 522f7a4be299fa745c72a996dbca583eb345fddb Mon Sep 17 00:00:00 2001 From: panxi Date: Mon, 29 Apr 2019 17:17:21 -0400 Subject: [PATCH 02/13] add index to tab for accessibility --- MVMCoreUI/Containers/TabBarController/TopTabbar.m | 1 + MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings | 1 + .../SupportingFiles/Strings/es-MX.lproj/Localizable.strings | 1 + MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings | 1 + 4 files changed, 4 insertions(+) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index 9b4e632c..6828f4a7 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -199,6 +199,7 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; NSString *accLabel = [title stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; cell.contentView.accessibilityLabel = accLabel; + cell.contentView.accessibilityValue = [NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"],indexPath.row + 1, [self.datasource numberOfTopTabbarItems:self]]; [cell.contentView setAccessibilityHint:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]]; if (indexPath.row == self.selectedIndex) { diff --git a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings index 472bb9b6..c622ccc4 100644 --- a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings @@ -11,6 +11,7 @@ // Tab "AccTab" = ", tab"; "AccTabHint" = "Double tap to select."; +"AccTabIndex" = "%ld of %ld"; // top alert "toptabbar_tab_selected" = ", tab, Selected"; "AccTopAlertClosed" = "Top alert notification is closed."; diff --git a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings index f640133a..fc314f81 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings @@ -10,6 +10,7 @@ // Tab "AccTab" = ", pestaña"; "AccTabHint" = "Toca dos veces para seleccionar."; +"AccTabIndex" = "%ld de %ld"; // top alert "toptabbar_tab_selected" = ", pestaña, Seleccionado"; "AccTopAlertClosed" = "La notificación de alerta máxima está desactivada."; diff --git a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings index f640133a..fc314f81 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings @@ -10,6 +10,7 @@ // Tab "AccTab" = ", pestaña"; "AccTabHint" = "Toca dos veces para seleccionar."; +"AccTabIndex" = "%ld de %ld"; // top alert "toptabbar_tab_selected" = ", pestaña, Seleccionado"; "AccTopAlertClosed" = "La notificación de alerta máxima está desactivada."; From a51079b601115ae8e691b0d066e33c57d29cff7c Mon Sep 17 00:00:00 2001 From: panxi Date: Mon, 29 Apr 2019 17:44:58 -0400 Subject: [PATCH 03/13] add 1of 3 into tabbar for accessibility team --- .../Containers/TabBarController/TopTabbar.m | 17 +++++++++-------- .../Strings/en.lproj/Localizable.strings | 2 +- .../Strings/es-MX.lproj/Localizable.strings | 2 +- .../Strings/es.lproj/Localizable.strings | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index 6828f4a7..fe4dd250 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -197,9 +197,9 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; cell.isAccessibilityElement = NO; cell.contentView.isAccessibilityElement = YES; - NSString *accLabel = [title stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; + NSString *titleString = [label.text stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + NSString *accLabel = [titleString stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; cell.contentView.accessibilityLabel = accLabel; - cell.contentView.accessibilityValue = [NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"],indexPath.row + 1, [self.datasource numberOfTopTabbarItems:self]]; [cell.contentView setAccessibilityHint:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]]; if (indexPath.row == self.selectedIndex) { @@ -405,16 +405,17 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; [cell layoutIfNeeded]; } - //setup selected tab accessibility - NSString *string = label.text; - NSString *accLabel = [string stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"toptabbar_tab_selected"]]; - cell.contentView.accessibilityLabel = accLabel; - [cell.contentView setAccessibilityHint:nil]; - self.selectedIndex = indexPath.row; if ([self.delegate respondsToSelector:@selector(topTabbar:titleForItemAtIndex:)]){ [self.delegate topTabbar:self didSelectItemAtIndex:indexPath.row]; } + + //setup selected tab accessibility + NSString *string = [label.text stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + NSString *accLabel = [string stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"toptabbar_tab_selected"]]; + cell.contentView.accessibilityLabel = accLabel; + [cell.contentView setAccessibilityHint:nil]; + } - (void)reloadData { diff --git a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings index c622ccc4..3132a67a 100644 --- a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings @@ -11,7 +11,7 @@ // Tab "AccTab" = ", tab"; "AccTabHint" = "Double tap to select."; -"AccTabIndex" = "%ld of %ld"; +"AccTabIndex" = ", %ld of %ld"; // top alert "toptabbar_tab_selected" = ", tab, Selected"; "AccTopAlertClosed" = "Top alert notification is closed."; diff --git a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings index fc314f81..f1092f8f 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings @@ -10,7 +10,7 @@ // Tab "AccTab" = ", pestaña"; "AccTabHint" = "Toca dos veces para seleccionar."; -"AccTabIndex" = "%ld de %ld"; +"AccTabIndex" = ", %ld de %ld"; // top alert "toptabbar_tab_selected" = ", pestaña, Seleccionado"; "AccTopAlertClosed" = "La notificación de alerta máxima está desactivada."; diff --git a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings index fc314f81..f1092f8f 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings @@ -10,7 +10,7 @@ // Tab "AccTab" = ", pestaña"; "AccTabHint" = "Toca dos veces para seleccionar."; -"AccTabIndex" = "%ld de %ld"; +"AccTabIndex" = ", %ld de %ld"; // top alert "toptabbar_tab_selected" = ", pestaña, Seleccionado"; "AccTopAlertClosed" = "La notificación de alerta máxima está desactivada."; From 884b18a8efe3a7f9cb5bdc2abddb0230c1e4e1d6 Mon Sep 17 00:00:00 2001 From: panxi Date: Tue, 30 Apr 2019 09:40:54 -0400 Subject: [PATCH 04/13] order fix --- MVMCoreUI/Containers/TabBarController/TopTabbar.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index fe4dd250..18131d53 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -197,9 +197,9 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; cell.isAccessibilityElement = NO; cell.contentView.isAccessibilityElement = YES; - NSString *titleString = [label.text stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; - NSString *accLabel = [titleString stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; - cell.contentView.accessibilityLabel = accLabel; + NSString *accLabel = [label.text stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; + NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + cell.contentView.accessibilityLabel = accString; [cell.contentView setAccessibilityHint:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]]; if (indexPath.row == self.selectedIndex) { @@ -411,9 +411,9 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; } //setup selected tab accessibility - NSString *string = [label.text stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; NSString *accLabel = [string stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"toptabbar_tab_selected"]]; - cell.contentView.accessibilityLabel = accLabel; + NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + cell.contentView.accessibilityLabel = accString; [cell.contentView setAccessibilityHint:nil]; } From 8ca991b322b10d57d8224e3fe96b1c2629c7a12e Mon Sep 17 00:00:00 2001 From: panxi Date: Wed, 1 May 2019 11:40:29 -0400 Subject: [PATCH 05/13] bug fix --- MVMCoreUI/Containers/TabBarController/TopTabbar.m | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index 18131d53..b69fc233 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -411,6 +411,7 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; } //setup selected tab accessibility + NSString *string = label.text; NSString *accLabel = [string stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"toptabbar_tab_selected"]]; NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; cell.contentView.accessibilityLabel = accString; From cff8361f9f63f94551018bd6263cbe42b9484a12 Mon Sep 17 00:00:00 2001 From: "Chowdhury, Shohrab" Date: Wed, 1 May 2019 14:00:57 -0400 Subject: [PATCH 06/13] allow user to overrise pannable Percentage value --- MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h | 3 +++ MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h index b08129f0..cfcf6320 100644 --- a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h +++ b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h @@ -25,6 +25,9 @@ // true while panning @property (nonatomic) BOOL panning; +//set pannable percentage 0 to 1 +@property (nonatomic) CGFloat pannablePercentage; + // can be used to keep track of if we are .. @property (nonatomic) BOOL interactive; diff --git a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m index de20ef53..b8e2cee4 100644 --- a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m +++ b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m @@ -8,8 +8,6 @@ #import "MFTabBarInteractor.h" -static CGFloat pannablePercentage = 0.15; - typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) { MFTabBarPanningDirectionLeft, MFTabBarPanningDirectionRight @@ -33,6 +31,7 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) { - (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id)delegate { if (self = [super init]) { + self.pannablePercentage = 0.15; self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)]; [viewController.view addGestureRecognizer:self.panGesture]; self.delegate = delegate; @@ -48,8 +47,8 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) { // Simulates an edge gesture by only accepting pans at the edge of the screen. Needed because edge gesture doesn't work nicely with extended menus such as on ipad. CGRect frame = pan.view.frame; - CGRect pannableFrameLeft = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width*pannablePercentage, frame.size.height); - CGRect pannableFrameRight = CGRectMake(frame.origin.x + frame.size.width*(1-pannablePercentage), frame.origin.y, frame.size.width*pannablePercentage, frame.size.height); + CGRect pannableFrameLeft = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width*self.pannablePercentage, frame.size.height); + CGRect pannableFrameRight = CGRectMake(frame.origin.x + frame.size.width*(1-self.pannablePercentage), frame.origin.y, frame.size.width*self.pannablePercentage, frame.size.height); switch (pan.state) { case UIGestureRecognizerStateBegan: From c99ffc1af7998e8a29c9583b1e274449e5d5218a Mon Sep 17 00:00:00 2001 From: panxi Date: Thu, 2 May 2019 13:59:50 -0400 Subject: [PATCH 07/13] avoid duplicate use --- .../Containers/TabBarController/TopTabbar.m | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index b69fc233..e1c96c20 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -193,14 +193,7 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; [label layoutIfNeeded]; label.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - //set up cell acceessibility label - cell.isAccessibilityElement = NO; - cell.contentView.isAccessibilityElement = YES; - - NSString *accLabel = [label.text stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTab"]]; - NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; - cell.contentView.accessibilityLabel = accString; - [cell.contentView setAccessibilityHint:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]]; + [self setCellAccessibility:cell title:label.text isSelected:NO]; if (indexPath.row == self.selectedIndex) { label.textColor = [UIColor mfTomatoRed]; @@ -410,17 +403,22 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; [self.delegate topTabbar:self didSelectItemAtIndex:indexPath.row]; } - //setup selected tab accessibility - NSString *string = label.text; - NSString *accLabel = [string stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:@"toptabbar_tab_selected"]]; - NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; - cell.contentView.accessibilityLabel = accString; - [cell.contentView setAccessibilityHint:nil]; - + [self setCellAccessibility:cell title:label.text isSelected:YES]; } - (void)reloadData { [self.collectionView reloadData]; } +- (void)setCellAccessibility:(UICollectionViewCell *)cell title:(NSString *)title isSelected:(BOOL)isSelected { + cell.isAccessibilityElement = NO; + cell.contentView.isAccessibilityElement = YES; + NSString *accKey = isSelected ? @"toptabbar_tab_selected" : @"AccTab"; + NSString *accLabel = [title stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:accKey]]; + NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + cell.contentView.accessibilityLabel = accString; + NSString *accHint = isSelected ? nil : [MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]; + [cell.contentView setAccessibilityHint:accHint]; +} + @end From 2fdd88356b71c18431848d7da75a8cc52aec8b40 Mon Sep 17 00:00:00 2001 From: panxi Date: Thu, 2 May 2019 14:34:39 -0400 Subject: [PATCH 08/13] update acc for mfstyler --- MVMCoreUI/Styles/MFStyler.m | 13 +++++++++---- .../Strings/en.lproj/Localizable.strings | 9 +++++++++ .../Strings/es-MX.lproj/Localizable.strings | 9 +++++++++ .../Strings/es.lproj/Localizable.strings | 9 +++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Styles/MFStyler.m b/MVMCoreUI/Styles/MFStyler.m index e7f14546..ca0fcd2e 100644 --- a/MVMCoreUI/Styles/MFStyler.m +++ b/MVMCoreUI/Styles/MFStyler.m @@ -13,6 +13,7 @@ #import "NSLayoutConstraint+MFConvenience.h" #import "MVMCoreUISplitViewController.h" @import MVMCore.MVMCoreDispatchUtility; +#import CGFloat const PaddingDefault = 24; CGFloat const PaddingDefaultHorizontalSpacing = 32; @@ -947,7 +948,8 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; if ([times containsObject:@"DD"]) { [timeString appendString:[NSString stringWithFormat:@"%02ld",days]]; if (timeUnit == MFTimeFormatNormal) { - NSString *dayUnit = (days <= 1) ? @" day": @" days"; + NSString *dayKey = (days <= 1) ? @"CountDownDay": @"CountDownDays"; + NSString *dayUnit = [MVMCoreUIUtility hardcodedStringWithKey:dayKey]; [timeString appendString:dayUnit]; } else if (timeUnit == MFTimeFormatColon && ![[times lastObject] isEqualToString:@"DD"]) { [timeString appendString:@" : "]; @@ -962,7 +964,8 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; } [timeString appendString:[NSString stringWithFormat:@"%02d",hours]]; if (timeUnit == MFTimeFormatNormal) { - NSString *hourUnit = (hours <= 1) ? @" hour": @" hours"; + NSString *hourKey = (hours <= 1) ? @"CountDownHour": @"CountDownHours"; + NSString *hourUnit = [MVMCoreUIUtility hardcodedStringWithKey:hourKey]; [timeString appendString:hourUnit]; } else if (timeUnit == MFTimeFormatColon && ![[times lastObject] isEqualToString:@"HH"]) { [timeString appendString:@" : "]; @@ -981,7 +984,8 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; } [timeString appendString:[NSString stringWithFormat:@"%02d",minutes]]; if (timeUnit == MFTimeFormatNormal) { - NSString *minuteUnit = (minutes <= 1) ? @" min": @" mins"; + NSString *minKey = (minutes <= 1) ? @"CountDownMin": @"CountDownMins"; + NSString *minuteUnit = [MVMCoreUIUtility hardcodedStringWithKey:minKey]; [timeString appendString:minuteUnit]; } else if (timeUnit == MFTimeFormatColon && ![[times lastObject] isEqualToString:@"MM"]) { [timeString appendString:@" : "]; @@ -1005,7 +1009,8 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; } [timeString appendString:[NSString stringWithFormat:@"%02d",seconds]]; if (timeUnit == MFTimeFormatNormal) { - NSString *secondUnit = (seconds <= 1) ? @" sec": @" secs"; + NSString *secondKey = (seconds <= 1) ? @"CountDownSec": @"CountDownSecs"; + NSString *secondUnit = [MVMCoreUIUtility hardcodedStringWithKey:secondKey]; [timeString appendString:secondUnit]; } } diff --git a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings index 3132a67a..96088cab 100644 --- a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings @@ -40,3 +40,12 @@ "AccOn" = "on"; "AccOff" = "off"; "AccToggleHint" = "double tap to toggle"; +//Styler +"CountDownDay" = " day"; +"CountDownHour" = " hour"; +"CountDownMin" = " min"; +"CountDownSec" = " sec"; +"CountDownDays" = " days"; +"CountDownHours" = " hours"; +"CountDownMins" = " mins"; +"CountDownSecs" = " secs"; diff --git a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings index f1092f8f..a006b218 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings @@ -39,3 +39,12 @@ "AccOn" = "encendido"; "AccOff" = "apagado"; "AccToggleHint" = "toca dos veces para alternar"; +//Styler +"CountDownDay" = " día"; +"CountDownHour" = " hora"; +"CountDownMin" = " min"; +"CountDownSec" = " seg"; +"CountDownDays" = " días"; +"CountDownHours" = " horas"; +"CountDownMins" = " min"; +"CountDownSecs" = " seg"; diff --git a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings index f1092f8f..a006b218 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings @@ -39,3 +39,12 @@ "AccOn" = "encendido"; "AccOff" = "apagado"; "AccToggleHint" = "toca dos veces para alternar"; +//Styler +"CountDownDay" = " día"; +"CountDownHour" = " hora"; +"CountDownMin" = " min"; +"CountDownSec" = " seg"; +"CountDownDays" = " días"; +"CountDownHours" = " horas"; +"CountDownMins" = " min"; +"CountDownSecs" = " seg"; From f8ec75c7d514f98909707d6cb2d680194af655d5 Mon Sep 17 00:00:00 2001 From: panxi Date: Thu, 2 May 2019 16:34:21 -0400 Subject: [PATCH 09/13] fix bug for tabbar --- MVMCoreUI/Containers/TabBarController/TopTabbar.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Containers/TabBarController/TopTabbar.m b/MVMCoreUI/Containers/TabBarController/TopTabbar.m index e1c96c20..c52e9d66 100644 --- a/MVMCoreUI/Containers/TabBarController/TopTabbar.m +++ b/MVMCoreUI/Containers/TabBarController/TopTabbar.m @@ -193,7 +193,7 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; [label layoutIfNeeded]; label.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - [self setCellAccessibility:cell title:label.text isSelected:NO]; + [self setCellAccessibility:cell title:label.text isSelected:NO indexPath:indexPath]; if (indexPath.row == self.selectedIndex) { label.textColor = [UIColor mfTomatoRed]; @@ -403,19 +403,19 @@ static NSString * const COLLECTION_CELL_ID = @"cell"; [self.delegate topTabbar:self didSelectItemAtIndex:indexPath.row]; } - [self setCellAccessibility:cell title:label.text isSelected:YES]; + [self setCellAccessibility:cell title:label.text isSelected:YES indexPath:indexPath]; } - (void)reloadData { [self.collectionView reloadData]; } -- (void)setCellAccessibility:(UICollectionViewCell *)cell title:(NSString *)title isSelected:(BOOL)isSelected { +- (void)setCellAccessibility:(UICollectionViewCell *)cell title:(NSString *)title isSelected:(BOOL)isSelected indexPath:(NSIndexPath *)indexPath { cell.isAccessibilityElement = NO; cell.contentView.isAccessibilityElement = YES; NSString *accKey = isSelected ? @"toptabbar_tab_selected" : @"AccTab"; NSString *accLabel = [title stringByAppendingString:[MVMCoreUIUtility hardcodedStringWithKey:accKey]]; - NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], self.selectedIndex + 1, [self.datasource numberOfTopTabbarItems:self]]]; + NSString *accString = [accLabel stringByAppendingString:[NSString stringWithFormat:[MVMCoreUIUtility hardcodedStringWithKey:@"AccTabIndex"], indexPath.row + 1, [self.datasource numberOfTopTabbarItems:self]]]; cell.contentView.accessibilityLabel = accString; NSString *accHint = isSelected ? nil : [MVMCoreUIUtility hardcodedStringWithKey:@"AccTabHint"]; [cell.contentView setAccessibilityHint:accHint]; From d2c489811bbf00a58f5b29fadca3d1e949646a03 Mon Sep 17 00:00:00 2001 From: "Murugan, Vimal" Date: Fri, 3 May 2019 20:03:48 +0530 Subject: [PATCH 10/13] setupview added to initialiser method --- MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m index f7239def..2af554c8 100644 --- a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m +++ b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m @@ -183,6 +183,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; - (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; if (self) { + [self setupView]; [self setupWithCheckedColor:[UIColor whiteColor] unCheckColor:[UIColor whiteColor] text:nil]; [self addAccessibleProperties]; } @@ -192,6 +193,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { + [self setupView]; [self setupWithCheckedColor:[UIColor whiteColor] unCheckColor:[UIColor whiteColor] text:nil]; [self addAccessibleProperties]; } @@ -243,6 +245,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; [self.checkMark.centerXAnchor constraintEqualToAnchor:self.checkedSquare.centerXAnchor].active = YES; [self.checkMark.centerYAnchor constraintEqualToAnchor:self.checkedSquare.centerYAnchor].active = YES; } else { + [self.checkMark removeFromSuperview]; [self.checkedSquare addSubview:self.checkMark]; } From c210ad80e417c07176d3911f8e6ae78aba0f34c2 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Fri, 3 May 2019 12:33:42 -0400 Subject: [PATCH 11/13] clear color --- MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m index 2af554c8..a7283de5 100644 --- a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m +++ b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m @@ -68,7 +68,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; NSString *checkedColorHex = [json string:@"checkedColor"]; NSString *unCheckedColorHex = [json string:@"unCheckedColor"]; - UIColor *checkedColor = checkedColorHex ? [UIColor mfGetColorForHex:checkedColorHex]: [UIColor blackColor]; + UIColor *checkedColor = checkedColorHex ? [UIColor mfGetColorForHex:checkedColorHex]: [UIColor clearColor]; UIColor *unCheckedColor = unCheckedColorHex ? [UIColor mfGetColorForHex:unCheckedColorHex]: [UIColor clearColor]; [self setupWithCheckedColor:checkedColor From d7069129d735e8d1f5692ae97d6a50e4894460f7 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Fri, 3 May 2019 14:01:35 -0400 Subject: [PATCH 12/13] remove from subview not needed --- MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m index a7283de5..ff46aa6a 100644 --- a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m +++ b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m @@ -243,10 +243,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; [self.checkMark.widthAnchor constraintEqualToAnchor:self.checkedSquare.widthAnchor multiplier:.4].active = YES; [self.checkMark.heightAnchor constraintEqualToAnchor:self.checkedSquare.heightAnchor multiplier:.4].active = YES; [self.checkMark.centerXAnchor constraintEqualToAnchor:self.checkedSquare.centerXAnchor].active = YES; - [self.checkMark.centerYAnchor constraintEqualToAnchor:self.checkedSquare.centerYAnchor].active = YES; - } else { - [self.checkMark removeFromSuperview]; - [self.checkedSquare addSubview:self.checkMark]; + [self.checkMark.centerYAnchor constraintEqualToAnchor:self.checkedSquare.centerYAnchor].active = YES; } //label From 1f3612186677dc19ca6e56cd01e142c9554ab175 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Mon, 6 May 2019 11:00:22 -0400 Subject: [PATCH 13/13] ONVIK-16357 --- MVMCoreUI/Atoms/Views/MFLoadImageView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atoms/Views/MFLoadImageView.swift b/MVMCoreUI/Atoms/Views/MFLoadImageView.swift index b08dc249..69ef1b6f 100644 --- a/MVMCoreUI/Atoms/Views/MFLoadImageView.swift +++ b/MVMCoreUI/Atoms/Views/MFLoadImageView.swift @@ -243,7 +243,7 @@ import UIKit // Gifs aren't supported by default and need special handling MVMCoreCache.shared()?.getGif(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, completionHandler: finishedLoadingBlock) } else { - MVMCoreCache.shared()?.getImage(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, localFallbackImageName: fallbackImageName, completionHandler: finishedLoadingBlock) + MVMCoreCache.shared()?.getImage(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, completionHandler: finishedLoadingBlock) } }) }