// // 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 PaddingBetweenFields; extern CGFloat const PaddingHorizontalHeadlineWhiteView; extern CGFloat const PaddingHorizontalLarge; extern CGFloat const PaddingVerticalWhiteGrayView; extern CGFloat const PaddingVerticalHeadlineAlternate; extern CGFloat const PaddingPrimaryButtonTop; // 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; // 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; //------------------------------------------------- // Returns the fonts for these styles. Scales them as needed by default #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 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 14pt + (nullable UIFont *)fontB4:(BOOL)genericScaling; + (nullable UIFont *)fontB4; #pragma mark - 1.0 fonts //75Bd 100pt + (nullable UIFont *)fontForPlan; //75Bd 48pt + (nullable UIFont *)fontForBiggerHeadline; //75Bd 26pt + (nullable UIFont *)fontForLoyaltySignUpHeadLine; //75Bd 40pt + (nullable UIFont *)fontForFeedHeadline; //55Rg 20pt + (nullable UIFont *)fontForFeedMessage; //55Rg 11pt + (nullable UIFont *)fontForFeedSubMessage; //75Bd 15pt + (nullable UIFont *)fontForHeadlineSmall; //75Bd 11pt + (nullable UIFont *)fontForHeadlineTiny; //75Bd 16pt + (nullable UIFont *)fontForHeadlineSmall2; //75Bd 32pt + (nullable UIFont *)fontForHeadlineLarge; //75Bd 36pt + (nullable UIFont *)fontForHeadlineExtraLarge; //75Bd 14pt + (nullable UIFont *)fontForSubheadBold; //75Md 20pt + (nullable UIFont *)fontForSubheadBoldLarge; //55Rg 14pt + (nullable UIFont *)fontforChatText; //55Rg 16pt + (nullable UIFont *)fontForAccountLandingGreeting; //55Rg 20pt + (nullable UIFont *)fontForBodyLarge; //Bold System 13 + (nullable UIFont *)fontForBodyBold; //55Rg 10pt + (nullable UIFont *)fontForProgressBarBottomLabel; //55Rg 14pt + (nullable UIFont *)fontForPrimaryButton; //55Rg 12pt + (nullable UIFont *)fontForSmallButton; //45Lt 20pt + (nullable UIFont *)fontForTextField; //55Rg 12pt + (nullable UIFont *)fontForTextFieldUnderLabel; //45Lt 24pt + (nullable UIFont *)fontForHeadlineAlternative; //65Md 16pt + (nullable UIFont *)fontForFeedCardTitle; //65Md 18pt + (nullable UIFont *)fontForSupportQuestionMark; //65Md 11pt + (nullable UIFont *)fontForSupportDateStamp; //65Md 10pt + (nullable UIFont *)fontForProgressBarTopLabel; //75Bd 20pt + (nullable UIFont *)fontForPlanCardTitle; //75Bd 18pt + (nullable UIFont *)fontForAccesseriesHeadline; //75Bd 60pt + (nullable UIFont *)fontForLargeLoyaltyHeaderTitle; //75Bd 42pt + (nullable UIFont *)fontForLoyaltyTitleSmall; //55Rg 20pt + (nullable UIFont *)fontForLoyaltyMessage; //45Lt 24pt only for support + (nullable UIFont *)fontForUnreadMessageOnSupport; // Returns the fonts for these styles allowing to apply a generic scale by device or not. + (nullable UIFont *)fontForHeadlineWithSize:(CGFloat)size genericScaling:(BOOL)genericScaling; + (nullable UIFont *)fontForFeedHeadline:(BOOL)genericScaling; + (nullable UIFont *)fontForFeedMessage:(BOOL)genericScaling; + (nullable UIFont *)fontForFeedSubMessage:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineSmall:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineSmall2:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineSmall2ForWidth:(CGFloat)size; + (nullable UIFont *)fontForHeadlineLarge:(BOOL)genericScaling; + (nullable UIFont *)fontForHeadlineExtraLarge:(BOOL)genericScaling; + (nullable UIFont *)fontB1ForWidth:(CGFloat)size; + (nullable UIFont *)fontForSubheadBold:(BOOL)genericScaling; + (nullable UIFont *)fontForSubheadBoldLarge:(BOOL)genericScaling; + (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 *)fontForBodyLarge:(BOOL)genericScaling; + (nullable UIFont *)fontForBodyBold:(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 *)fontForSupportQuestionMark:(BOOL)genericScaling; + (nullable UIFont *)fontForSupportDateStamp:(BOOL)genericScaling; + (nullable UIFont *)fontForProgressBarTopLabel:(BOOL)genericScaling; + (nullable UIFont *)fontForPlanCardTitle:(BOOL)genericScaling; + (nullable UIFont *)fontForAccesseriesHeadline:(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 - 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)styleLabelB1:(nonnull UILabel *)label; + (void)styleLabelB1:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (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)styleLabelB4:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelB4:(nonnull UILabel *)label; + (void)styleLabelTextStyle2:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelTextStyle2:(nonnull UILabel *)label; #pragma mark - 1.0 styles + (void)styleLabelHeadlineLarge:(nonnull UILabel *)label; + (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label; + (void)styleLabelHeadlineFeed:(nonnull UILabel *)label; + (void)styleLabelFeedMessage:(nonnull UILabel *)label; + (void)styleLabelFeedSubMessage:(nonnull UILabel *)label; + (void)styleLabelSubheadBold:(nonnull UILabel *)label; + (void)styleLabelB2:(nonnull UILabel *)label; + (void)styleLabelBodyLarge:(nonnull UILabel *)label; + (void)styleLabelBodyBold:(nonnull UILabel *)label; + (void)styleLabelBodyLighter:(nonnull UILabel *)label; + (void)styleFeedCardTitleLabel:(nonnull UILabel *)label; + (void)styleFeedCardTagLabel:(nonnull UILabel *)label; + (void)styleStandardSeparatorView:(nonnull UIView *)view; + (void)styleLabelHeadlineSmall:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelHeadlineLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelHeadlineExtraLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelHeadlineFeed:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelFeedMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelFeedSubMessage:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelH2:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling; + (void)styleLabelHeadlineBlack:(nonnull UILabel *)label size:(CGFloat)size genericScaling:(BOOL)genericScaling; + (void)styleLabelSubheadBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelSubheadBoldLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBodyLarge:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBodyBold:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleLabelBodyLighter:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleFeedCardTitleLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; + (void)styleFeedCardTagLabel:(nonnull UILabel *)label genericScaling:(BOOL)genericScaling; //------------------------------------------------- // Sets the text with strings attributed with these styles. + (void)styleSetLabelTextWithH2:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithHeadlineLarge:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithHeadlineExtraLarge:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithH3:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithB2:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithBodyBold:(nonnull UILabel *)label text:(nullable NSString *)text; + (void)styleSetLabelTextWithB3:(nonnull UILabel *)label text:(nullable NSString *)text; #pragma mark - Attributed Strings + (nonnull NSAttributedString *)styleGetAttributedString:(nullable NSString *)string font:(nonnull UIFont *)font color:(nonnull UIColor *)color; + (nonnull NSAttributedString *)styleGetHeadlineAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetHeadlineLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetHeadlineExtraLargeAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetSubheadAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBodyAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetBodyBoldAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetDisabledBodyAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetLegalAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetSubtitleAttributedString:(nullable NSString *)string; + (nonnull NSAttributedString *)styleGetDisabledSubtitleAttributedString:(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