// // MFStyler.h // myverizon // // Created by Scott Pfeil on 11/26/14. // Copyright (c) 2014 Verizon Wireless. All rights reserved. // // Styles for mobile first. #import #import @class MFSizeObject; //enum for border typedef NS_ENUM(NSInteger, MFViewBorder){ MFViewBorderTop, MFViewBorderLeft, MFViewBorderBottom, MFViewBorderRight }; typedef NS_ENUM(NSUInteger, MFTimeFormatUnit) { MFTimeFormatColon = 0, /*!{days} : {hour} : {minutes} : {seconds} */ MFTimeFormatNormal /* will end with days hours minutes seconds, when left days less than 2, it will change to 'day'*/ }; // Some standard spacings. Use these to stay consistent across the app. extern CGFloat const PaddingDefault; extern CGFloat const PaddingDefaultHorizontalSpacing; extern CGFloat const PaddingDefaultVerticalSpacing; extern CGFloat const PaddingDefaultVerticalSpacing3; extern CGFloat const PaddingBetweenFields; extern CGFloat const PaddingHorizontalHeadlineWhiteView; extern CGFloat const PaddingHorizontalLarge; extern CGFloat const PaddingVerticalWhiteGrayView; extern CGFloat const PaddingVerticalHeadlineAlternate; extern CGFloat const PaddingPrimaryButtonTop; extern CGFloat const PaddingHorizontalBetweenRelatedItems; // These are based on the multiple of 6 rule extern CGFloat const PaddingOne; extern CGFloat const PaddingTwo; extern CGFloat const PaddingThree; extern CGFloat const PaddingFour; extern CGFloat const PaddingFive; extern CGFloat const PaddingSix; extern CGFloat const PaddingSeven; extern CGFloat const PaddingEight; extern CGFloat const PaddingNine; extern CGFloat const PaddingTen; extern CGFloat const TableCellParagraphSpace; extern CGFloat const FooterLabelParagraphSpace; extern CGFloat const WebViewInset; extern CGFloat const HeightTableSeperatorHeight; extern CGFloat const MFHeightForSwitch; extern CGFloat const MFMFWidthForSwitch; extern CGFloat const HeaderMaxWidth; // Color constants extern CGFloat const DisableOppacity; extern CGFloat const PaymentMethodViewHeightWidthMultiplier; extern CGFloat const MinCellHeight; extern CGFloat const HeightIphone5; extern CGFloat const DefaultOptionCellHeight; extern CGFloat const LabelWithInternalButtonLineSpace; extern CGFloat const PromoViewHeight; @interface MFStyler : NSObject // RoundedButtons /**********Style Guidelines for BrandRefresh: ********* H1 -> HeadlineLarge H2 -> Headline H3 -> SubHead B1 -> SubTitle B2 -> Body B3 -> Legal *****************************************************/ // Generic scaling based on the detail width. + (nullable MFSizeObject *)sizeObjectGenericForCurrentDevice:(CGFloat)size; + (CGFloat)sizeFontGenericForCurrentDevice:(CGFloat)size; #pragma mark - Spacing Defaults + (CGFloat)defaultHorizontalPaddingForApplicationWidth; + (CGFloat)defaultVerticalPaddingForApplicationWidth; + (CGFloat)defaultHorizontalPaddingForSize:(CGFloat)size; + (CGFloat)defaultVerticalPaddingForSize:(CGFloat)size; + (void)setDefaultMarginsForView:(nullable UIView *)view size:(CGFloat)size; + (void)setDefaultMarginsForView:(nullable UIView *)view size:(CGFloat)size horizontal:(BOOL)horizontal vertical:(BOOL)vertical; + (void)setMarginsForView:(nullable UIView *)view size:(CGFloat)size defaultHorizontal:(BOOL)horizontal top:(CGFloat)top bottom:(CGFloat)bottom; //------------------------------------------------- // Returns the fonts for these styles. Scales them as needed by default #pragma mark - 3.0 fonts ///auto select corresponding font based on font size, DS for font bigger than 15 pt, TX for font smaller than 15 pt + (nonnull UIFont *)getMVA3FontSize:(CGFloat)size bold:(BOOL)isBold; ///Bold 36pt + (nonnull UIFont *)fontTitle2XLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontTitle2XLarge; ///Bold 32pt + (nonnull UIFont *)fontTitleXLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontTitleXLarge; ///Bold 24pt + (nonnull UIFont *)fontBoldTitleLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontBoldTitleLarge; ///Regular 24pt + (nonnull UIFont *)fontRegularTitleLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontRegularTitleLarge; ///Bold 20pt + (nonnull UIFont *)fontBoldTitleMedium:(BOOL)genericScaling; + (nonnull UIFont *)fontBoldTitleMedium; ///Regular 20pt + (nonnull UIFont *)fontRegularTitleMedium:(BOOL)genericScaling; + (nonnull UIFont *)fontRegularTitleMedium; ///Bold 16pt + (nonnull UIFont *)fontBoldBodyLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontBoldBodyLarge; ///Regular 16pt + (nonnull UIFont *)fontRegularBodyLarge:(BOOL)genericScaling; + (nonnull UIFont *)fontRegularBodyLarge; ///Bold 13pt + (nonnull UIFont *)fontBoldBodySmall:(BOOL)genericScaling; + (nonnull UIFont *)fontBoldBodySmall; ///Regular 13pt + (nonnull UIFont *)fontRegularBodySmall:(BOOL)genericScaling; + (nonnull UIFont *)fontRegularBodySmall; ///Bold 11pt + (nonnull UIFont *)fontBoldMicro:(BOOL)genericScaling; + (nonnull UIFont *)fontBoldMicro; ///Regular 11pt + (nonnull UIFont *)fontRegularMicro:(BOOL)genericScaling; + (nonnull UIFont *)fontRegularMicro; #pragma mark - 2.0 fonts //75Bd 40pt + (nullable UIFont *)fontH1:(BOOL)genericScaling; + (nullable UIFont *)fontH1; //75Bd 25pt + (nullable UIFont *)fontH2:(BOOL)genericScaling; + (nullable UIFont *)fontH2; //75Bd 18pt + (nullable UIFont *)fontH3:(BOOL)genericScaling; + (nullable UIFont *)fontH3; //75Bd 32pt + (nullable UIFont *)fontH32:(BOOL)genericScaling; + (nullable UIFont *)fontH32; //75Bd 13pt + (nullable UIFont *)fontB1:(BOOL)genericScaling; + (nullable UIFont *)fontB1; //55Rg 13pt + (nullable UIFont *)fontB2:(BOOL)genericScaling; + (nullable UIFont *)fontB2; //55Rg 11pt + (nullable UIFont *)fontB3:(BOOL)genericScaling; + (nullable UIFont *)fontB3; //55Rg 20pt + (nullable UIFont *)fontB20:(BOOL)genericScaling; + (nullable UIFont *)fontB20; #pragma mark - 1.0 fonts //75Bd 100pt + (nullable UIFont *)fontForPlan; //75Bd 48pt + (nullable UIFont *)fontForBiggerHeadline; //75Bd 15pt + (nullable UIFont *)fontForHeadlineSmall; //55Rg 14pt + (nullable UIFont *)fontforChatText; //55Rg 16pt + (nullable UIFont *)fontForAccountLandingGreeting; //55Rg 10pt + (nullable UIFont *)fontForProgressBarBottomLabel; //55Rg 14pt + (nullable UIFont *)fontForPrimaryButton; //75Bd 11pt + (nullable UIFont *)fontForSmallButton; //55Rg 16pt + (nullable UIFont *)fontForTextField; //55Rg 12pt + (nullable UIFont *)fontForTextFieldUnderLabel; //55Rg 24pt + (nullable UIFont *)fontForHeadlineAlternative; //75Bd 16pt + (nullable UIFont *)fontForFeedCardTitle; //75Bd 60pt + (nullable UIFont *)fontForLargeLoyaltyHeaderTitle; //75Bd 42pt + (nullable UIFont *)fontForLoyaltyTitleSmall; //55Rg 20pt + (nullable UIFont *)fontForLoyaltyMessage; //75Bd 10pt only for support + (nullable UIFont *)fontForUnreadMessageOnSupport; //55Rg 16pt for 5G flow + (nullable UIFont *)font5GMessage:(BOOL)genericScaling; //55Rg 16pt for 5G flow scale YES + (nullable UIFont *)font5GMessage; // Returns the fonts for these styles allowing to apply a generic scale by device or not. + (nullable UIFont *)fontForBiggerHeadLine:(BOOL)genericScaling; + (nullable UIFont *)fontForPlan:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineSmall2; + (nullable UIFont *)fontForHeadlineSmall2:(BOOL)genericScaling; + (nullable UIFont *)fontB1ForWidth:(CGFloat)size; + (nullable UIFont *)fontForBodyWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling; + (nullable UIFont *)fontB2ForWidth:(CGFloat)size; + (nullable UIFont *)fontForBodyWithSize:(CGFloat)size forWidth:(CGFloat)width; + (nullable UIFont *)fontforChatText:(BOOL)genericScaling; + (nullable UIFont *)fontForAccountLandingGreeting:(BOOL)genericScaling; + (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling; + (nullable UIFont *)fontForPrimaryButtonForWidth:(CGFloat)size; + (nullable UIFont *)fontForSmallButton:(BOOL)genericScaling; + (nullable UIFont *)fontForSmallButtonForWidth:(CGFloat)size; + (nullable UIFont *)fontForTextField:(BOOL)genericScaling; + (nullable UIFont *)fontForTextFieldUnderLabel:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineAlternative:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineAlternativeForWidth:(CGFloat)size; + (nullable UIFont *)fontForFeedCardTitle:(BOOL)genericScaling; + (nullable UIFont *)fontForLargeLoyaltyHeaderTitle:(BOOL)genericScaling; + (nullable UIFont *)fontForLoyaltyTitleSmall:(BOOL)genericScaling; + (nullable UIFont *)fontForLoyaltyMessage:(BOOL)genericScaling; + (nullable UIFont *)fontForPtPCard:(BOOL)genericScaling; + (nullable UIFont *)fontForLabelWithTopLeftCircleWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling; + (nullable UIFont *)fontOcratxtWitSize:(CGFloat)size genericScaling:(BOOL)genericScaling; + (nullable UIFont *)fontH255:(BOOL)genericScaling; + (nonnull UIFont *) boldFontForScaledSize:(CGFloat)size; + (nonnull UIFont *) regularFontForScaledSize:(CGFloat)size; //------------------------------------------------- // Applies the styles to the passed in objects. #pragma mark - 3.0 Styles + (void)styleLabelTitle2XLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelTitle2XLarge:(nonnull UILabel *)label; + (void)styleLabelTitleXLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelTitleXLarge:(nonnull UILabel *)label; + (void)styleLabelBoldTitleLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBoldTitleLarge:(nonnull UILabel *)label; + (void)styleLabelRegularTitleLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelRegularTitleLarge:(nonnull UILabel *)label; + (void)styleLabelBoldTitleMedium:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBoldTitleMedium:(nonnull UILabel *)label; + (void)styleLabelRegularTitleMedium:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelRegularTitleMedium:(nonnull UILabel *)label; + (void)styleLabelBoldBodyLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBoldBodyLarge:(nonnull UILabel *)label; + (void)styleLabelRegularBodyLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelRegularBodyLarge:(nonnull UILabel *)label; + (void)styleLabelBoldBodySmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBoldBodySmall:(nonnull UILabel *)label; + (void)styleLabelRegularBodySmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelRegularBodySmall:(nonnull UILabel *)label; + (void)styleLabelBoldMicro:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBoldMicro:(nonnull UILabel *)label; + (void)styleLabelRegularMicro:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelRegularMicro:(nonnull UILabel *)label; #pragma mark - 2.0 styles + (void)styleLabelH1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelH1:(nonnull UILabel *)label; + (void)styleLabelH2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelH2:(nonnull UILabel *)label; + (void)styleLabelH3:(nonnull UILabel *)label; + (void)styleLabelH3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelH32:(nonnull UILabel *)label; + (void)styleLabelH32:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB1:(nonnull UILabel *)label; + (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB2:(nonnull UILabel *)label; + (void)styleLabelB2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling; + (void)styleLabelB3:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB3:(nonnull UILabel *)label; + (void)styleLabelB20:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB20:(nonnull UILabel *)label; + (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelTextStyle2:(nonnull UILabel *)label; #pragma mark - 1.0 styles + (void)styleFeedCardTitleLabel:(nonnull UILabel *)label; + (void)styleFeedCardTagLabel:(nonnull UILabel *)label; + (void)styleStandardSeparatorView:(nonnull UIView *)view; + (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleFeedCardTagLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; //------------------------------------------------- #pragma mark - Attributed Strings + (nonnull NSAttributedString *)styleGetTitle2XLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetTitle2XLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetTitleXLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetTitleXLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetBoldTitleLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBoldTitleLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetRegularTitleLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetRegularTitleLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetBoldTitleMediumAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBoldTitleMediumAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetRegularTitleMediumAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetRegularTitleMediumAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetBoldBodyLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBoldBodyLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetRegularBodyLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetRegularBodyLargeAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetBoldBodySmallAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBoldBodySmallAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetRegularBodySmallAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetRegularBodySmallAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetBoldMicroAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBoldMicroAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetRegularMicroAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetRegularMicroAttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color; + (nonnull NSAttributedString *)styleGetH1AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetH2AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetH3AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetB1AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetB2AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetB3AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetH1AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetH2AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetH3AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetH32AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetB1AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetB2AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetB3AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetB20AttributedString:(nullable NSString *)string genericScaling:(BOOL)genericScaling; + (nonnull NSAttributedString *)styleGetDisabledB2AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetDisabledB1AttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftString:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color; + (nonnull NSAttributedString *)styleGetTopAlignedAttributeStringWithLeftStringRightTop:(nullable NSString *)left centerString:(nonnull NSString *)center rightString:(nullable NSString *)right withCenterStringFontSize:(CGFloat)fontSize andColor:(nonnull UIColor *)color; + (void)styleGetAlignCenteredAttrituedString:(nullable NSMutableAttributedString *)string; +(nonnull NSAttributedString *)styleGetBoldStringWithFont:(nonnull UIFont *)inputFont fromString:(nonnull NSString *)inputString; +(nonnull NSString *)styleGetLowCaseSpace:(nullable NSString *)inputString; //------------------------------------------------- // Returns colors for Gradient Text presets + (nonnull NSArray *)gradientSpecialTicketGold; + (nonnull NSArray *)gradientSpecialTicketGoldCGColor; #pragma mark - Custom Styling Views + (void)styleView:(nonnull UIView *)view showMFViewBorder:(MFViewBorder)border withColor:(nonnull UIColor *)color borderLineWidth:(CGFloat)borderLineWidth borderLineLength:(CGFloat)borderLineLengh; + (void)styleTextField:(nonnull UITextField *)textField; + (nullable UIImage *)grayscaleImage:(nullable UIImage *)image; + (void)setGradientToLabel:(nonnull UILabel*)label withColors:(nonnull NSArray*)colors; + (nonnull NSDictionary *)labelStrokeAttributes:(nonnull UIColor *)color; + (void)mfStyleBlackPageControl:(nullable UIPageControl *)pageControl; + (void)mfStylePageControl:(nullable UIPageControl *)pageControl; // leftTime should be left seconds // timeformat should follow "DD:HH:MM:SS", No space inside! + (nonnull NSString *)getCountTime:(NSInteger)leftTime timeformat:(nonnull NSString *)timeFormat timeUnit:(MFTimeFormatUnit)timeUnit timeSuffix:(nullable NSString *)suffix; + (CGFloat)splitTextFieldWidth; + (CGFloat)splitTextFieldWidthForViewWidth:(CGFloat)width; @end