From 45689c7c51b7ee1ad99a2a5f9c93e9ec8dbe05d8 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Sat, 27 Jul 2019 17:31:19 -0400 Subject: [PATCH 1/3] Made fix to TopLabelBottomButtomVC. Added close X image to replace 'X' char. --- .../TopLabelsAndBottomButtonsViewController.h | 1 + .../TopLabelsAndBottomButtonsViewController.m | 5 ++-- .../closeXBlack.imageset/Contents.json | 23 ++++++++++++++++++ .../closeXBlack.imageset/closeXBlack.png | Bin 0 -> 215 bytes .../closeXBlack.imageset/closeXBlack@2x.png | Bin 0 -> 374 bytes .../closeXBlack.imageset/closeXBlack@3x.png | Bin 0 -> 535 bytes .../Utility/MVMCoreUICommonViewsUtility.m | 2 +- 7 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/Contents.json create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@2x.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png diff --git a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h index 720f0097..4abdb035 100644 --- a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h +++ b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h @@ -24,6 +24,7 @@ @property (nullable, weak, nonatomic) UIView *viewOutOfScroll; @property (nullable, strong, nonatomic) UIView *safeAreaView; @property (nullable, weak, nonatomic) ViewConstrainingView *bottomAccessoryView; +//@property (nullable, strong, nonatomic) NSLayoutConstraint *heightConstraint; // Set to overwrite which view is the top edge and/or bottom edge of the between view. must be added to the ui and constrained before buildViewsBetweenLabelsAndButtons. // Use these to create views that are pinned near the labels or buttons and are separate from any centered content. Add and set in buildInAdditionalViewsBeforeCenteredContent. diff --git a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.m b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.m index 0fcc51a2..77472e11 100644 --- a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.m +++ b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.m @@ -303,8 +303,9 @@ } - (void)addViewToContentView:(UIView *)bottomView { - - self.bottomConstraint.active = YES; + if (![self bottomViewOutsideOfScroll]) { + self.bottomConstraint.active = YES; + } // Buttons will be at the bottom of the content view. [self.contentView addSubview:bottomView]; diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/Contents.json new file mode 100644 index 00000000..d7771f8a --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "closeXBlack.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "closeXBlack@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "closeXBlack@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack.png b/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack.png new file mode 100644 index 0000000000000000000000000000000000000000..5f31bd2848e43db0f21a371def0f620059cf46a6 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|#^NA%Cx&(BWL^R}6FprVLo5W> zPH_}!P~dQ#+ZQ1I`d@j*%{a|KqaQ1hjrlnK*Uk`Y`%vfJXS{I3l$e)ug!PUH>^Amp zwVo?zJlRm%#@8kMHP@$WvA30tuLyHr4`JRCrRt#OIFtEE-p0n?{${t6W81ec)cCxR zQ)Px$FiAu~R9Fekm|+gWAPj{UPr`q_|9SZBCA3vp7&7+yC~Qs0q_ppQu(%~#mJ3G^ zZ;uoFDO1^-2r`Q@o-$^dQkF8Kj38r;yZq9H*Y7&RR5Fv8>R}UQ!AMgu3ohJj#WpcB z%nb%Vv^L$?FxRcwEs&XW)AA7V(8%`oeJ-(&1a~vZ86(W}Bp!6N04%i-e6I)rAvJsY zRK5jltx+(vsRpj)P(7Er(g6EUbTN}ea#QK8tvNbwbms*d^V8AWb?PlE&FH+An{tjV zaBFRdIRuE*xR|qmEVYz52Eg<{=6ZyCdaLF<1U)o9=G=rtty`;GpmN@{Cf!&uQKrn= z=7y38%wYyx2tbcY4q2D`*brn(QHH*;)%~nUClv)4N~k9OK8ch?1Ln#M19W{P-_;Ag UXN9MmJpcdz07*qoM6N<$g7AT$p8x;= literal 0 HcmV?d00001 diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..598475659e712adada27405d4a675351fa7a3a92 GIT binary patch literal 535 zcmV+y0_gpTP)Px$(Md!>RA>e5nq5xAFc5?*o_OZsy$-kFNZ_gDDr(m0{>+#dYRPJecW1tF3{p@o zm)BT(2i_b0wat%(Vt^IQU^fRAKHL0m^Q+Aj!hsR2Ute6MbQRM^7L))=Z7a+D+6?0v9```_ zGShIH*EFNeR?0o)2AeRCUuE7h;l~6AKhqiLf(P)=mS`+Ap=ZQ_^)gdgAOIUJO|zvN zqlAU}Fk`r(09S1dv0j^7|3^#sjh8BEqTdRK47>4XU+Y6sghOiV#wr7>U^d@XTqVSd Z^9Mh_uZWnsYPA3W002ovPDHLkV1mNA@q_>X literal 0 HcmV?d00001 diff --git a/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m b/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m index 487a7b51..41237640 100644 --- a/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m +++ b/MVMCoreUI/Utility/MVMCoreUICommonViewsUtility.m @@ -181,7 +181,7 @@ static const CGFloat VertialShadowOffset = 6; + (nonnull MFCustomButton *)addCloseButtonToView:(UIView *)view action:(ButtonTapBlock)actionBlock verticalCentered:(BOOL)verticalCentered { MFCustomButton *button = [[MFCustomButton alloc] initWithFrame:CGRectZero]; button.translatesAutoresizingMaskIntoConstraints = NO; - [button setTitle:@"✕" forState:UIControlStateNormal]; + [button setImage:[MVMCoreUIUtility imageNamed:@"closeXBlack"] forState:UIControlStateNormal]; button.titleLabel.font = [MFStyler fontForHeadlineAlternative]; //accessibility From 1ec98eb29a9e9d5aca6e78311d57b886ebf1024a Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 5 Aug 2019 11:50:15 -0400 Subject: [PATCH 2/3] Needed to expose a few properties of the class in order to have adapt it to slight changes for use in support class. --- MVMCoreUI/Atoms/Views/MFRadioButton.h | 8 ++++++-- MVMCoreUI/Atoms/Views/MFRadioButton.m | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/MFRadioButton.h b/MVMCoreUI/Atoms/Views/MFRadioButton.h index 86837256..c5e053c0 100644 --- a/MVMCoreUI/Atoms/Views/MFRadioButton.h +++ b/MVMCoreUI/Atoms/Views/MFRadioButton.h @@ -30,7 +30,6 @@ typedef void (^PerformActionForRadioButton)(void); @property (nullable, copy, nonatomic) PerformActionForRadioButton performActionForCheck; typedef void (^CircleSelectedClosure)(_Nonnull id sender); - @property (nonatomic, strong, nullable) UIColor* fillColor; @property (nonatomic, strong, nullable) UIColor* borderColor; @property (nonatomic) CGFloat circleBorderWidth; @@ -38,11 +37,16 @@ typedef void (^CircleSelectedClosure)(_Nonnull id sender); @property (nonatomic, copy, nullable) CircleSelectedClosure handleSelectionBlock; @property (nonatomic) CGFloat circleDiameter; @property (nonatomic, nullable, strong, readonly) CAShapeLayer * myCircle; - +@property (nullable, weak, nonatomic) UIView *outerCircleView; +@property (nullable, weak, nonatomic) UIView *innerCircleView; @property (nonatomic, strong, nullable) NSLayoutConstraint *heightConstraint; @property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint; @property (nonatomic) BOOL respondsToTapGesture; @property (nonatomic, getter = isSelected) BOOL selected; +@property (strong, nonatomic) NSLayoutConstraint *innerHeightConstarint; +@property (strong, nonatomic) NSLayoutConstraint *innerWidthConstarint; +@property (strong, nonatomic) NSLayoutConstraint *outerHeightConstarint; +@property (strong, nonatomic) NSLayoutConstraint *outerWidthConstarint; // Set line width manually - (void)setCheckMarkLineWidth:(CGFloat)lineWidth; diff --git a/MVMCoreUI/Atoms/Views/MFRadioButton.m b/MVMCoreUI/Atoms/Views/MFRadioButton.m index d1a9ee03..06f6c3a0 100644 --- a/MVMCoreUI/Atoms/Views/MFRadioButton.m +++ b/MVMCoreUI/Atoms/Views/MFRadioButton.m @@ -12,11 +12,6 @@ static CGFloat const DefaultOuterCircleSize = 31; static CGFloat const DefaultInnerCircleSize = 19; -@interface MFRadioButton () -@property (nullable, weak, nonatomic) UIView *outerCircleView; -@property (nullable, weak, nonatomic) UIView *innerCircleView; -@end - @implementation MFRadioButton @@ -64,9 +59,11 @@ static CGFloat const DefaultInnerCircleSize = 19; [outerCircleView.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES; [outerCircleView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES; [outerCircleView.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES; - - [outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES; - [outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES; + + self.outerHeightConstarint = [outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize]; + self.outerHeightConstarint.active = YES; + self.outerWidthConstarint = [outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize]; + self.outerWidthConstarint.active = YES; UIView *innerCircleView = [[UIView alloc] init]; [outerCircleView addSubview:innerCircleView]; @@ -76,8 +73,11 @@ static CGFloat const DefaultInnerCircleSize = 19; [innerCircleView.centerXAnchor constraintEqualToAnchor:outerCircleView.centerXAnchor].active = YES; [innerCircleView.centerYAnchor constraintEqualToAnchor:outerCircleView.centerYAnchor].active = YES; - [innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES; - [innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES; + + self.innerHeightConstarint = [innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize]; + self.innerHeightConstarint.active = YES; + self.innerWidthConstarint = [innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize]; + self.innerWidthConstarint.active = YES; outerCircleView.userInteractionEnabled = NO; innerCircleView.userInteractionEnabled = NO; From d4a19d9086fa9bec04cbe558055f8960161b5177 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 9 Aug 2019 09:45:44 -0400 Subject: [PATCH 3/3] Removed unneeded line. --- .../LegacyControllers/TopLabelsAndBottomButtonsViewController.h | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h index 4abdb035..720f0097 100644 --- a/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h +++ b/MVMCoreUI/LegacyControllers/TopLabelsAndBottomButtonsViewController.h @@ -24,7 +24,6 @@ @property (nullable, weak, nonatomic) UIView *viewOutOfScroll; @property (nullable, strong, nonatomic) UIView *safeAreaView; @property (nullable, weak, nonatomic) ViewConstrainingView *bottomAccessoryView; -//@property (nullable, strong, nonatomic) NSLayoutConstraint *heightConstraint; // Set to overwrite which view is the top edge and/or bottom edge of the between view. must be added to the ui and constrained before buildViewsBetweenLabelsAndButtons. // Use these to create views that are pinned near the labels or buttons and are separate from any centered content. Add and set in buildInAdditionalViewsBeforeCenteredContent.