Skip to content

Commit

Permalink
[Snackbar] Deprecate more class methods on MDCSnackbarManager.
Browse files Browse the repository at this point in the history
Also undeprecated the accidental deprecation of the instance property, messageTextColor.

PiperOrigin-RevId: 326252484
  • Loading branch information
jverkoey authored and material-automation committed Aug 12, 2020
1 parent 91a2953 commit 8dc2768
Showing 1 changed file with 58 additions and 48 deletions.
106 changes: 58 additions & 48 deletions components/Snackbar/src/MDCSnackbarManager.h
Expand Up @@ -165,6 +165,11 @@
*/
@property(nonatomic, strong, nullable) UIFont *messageFont;

/**
The color for the message text in the Snackbar message view.
*/
@property(nonatomic, strong, nullable) UIColor *messageTextColor;

/**
The font for the button text in the Snackbar message view.
*/
Expand Down Expand Up @@ -295,58 +300,11 @@
*/
+ (void)showMessage:(nullable MDCSnackbarMessage *)message;

/**
Calls @c -setPresentationHostView: on the @c defaultManager instance.
*/
+ (void)setPresentationHostView:(nullable UIView *)hostView;

/**
Calls @c -hasMessagesShowingORQueued on the @c defaultManager instance.
*/
+ (BOOL)hasMessagesShowingOrQueued;

/**
Calls @c -dismissAndCallCompletionBlocksWithCategory: on the @c defaultManager instance.
*/
+ (void)dismissAndCallCompletionBlocksWithCategory:(nullable NSString *)category;

/**
Calls -setBottomOffset: on the @c defaultManager instance.
*/
+ (void)setBottomOffset:(CGFloat)offset;

/**
Calls @c -suspendAllMessages on the @c defaultManager instance.
*/
+ (nullable id<MDCSnackbarSuspensionToken>)suspendAllMessages;

/**
Calls @c -suspendMessagesWithCategory: on the @c defaultManager instance.
*/
+ (nullable id<MDCSnackbarSuspensionToken>)suspendMessagesWithCategory:
(nullable NSString *)category;

/**
Calls @c -resumeMessagesWithToken: on the @c defaultManager instance.
*/
+ (void)resumeMessagesWithToken:(nullable id<MDCSnackbarSuspensionToken>)token;

/**
Calls @c -setButtonTitleColor:forState: on the @c defaultManager instance.
*/
+ (void)setButtonTitleColor:(nullable UIColor *)titleColor forState:(UIControlState)state;

/**
Bound to @c messageTextColor on the @c defaultManager instance.
*/
@property(class, nonatomic, strong, nullable) UIColor *messageTextColor;

/**
Bound to @c mdc_adjustsFontForContentSizeCategory on the @c defaultManager instance.
*/
@property(class, nonatomic, readwrite, setter=mdc_setAdjustsFontForContentSizeCategory:)
BOOL mdc_adjustsFontForContentSizeCategory;

/**
Bound to @c delegate on the @c defaultManager instance.
*/
Expand Down Expand Up @@ -379,7 +337,7 @@
/**
The color for the message text in the Snackbar message view.
*/
@property(nonatomic, strong, nullable) UIColor *messageTextColor __deprecated_msg(
@property(class, nonatomic, strong, nullable) UIColor *messageTextColor __deprecated_msg(
"Use MDCSnackbarManager.defaultManager.messageTextColor instead.");

/**
Expand All @@ -395,6 +353,13 @@
UIFont *buttonFont __deprecated_msg("Use MDCSnackbarManager.defaultManager.buttonFont instead.")
;

/**
Bound to @c mdc_adjustsFontForContentSizeCategory on the @c defaultManager instance.
*/
@property(class, nonatomic, readwrite, setter=mdc_setAdjustsFontForContentSizeCategory:)
BOOL mdc_adjustsFontForContentSizeCategory __deprecated_msg(
"Use MDCSnackbarManager.defaultManager.mdc_adjustsFontForContentSizeCategory instead.");

/**
Bound to @c shouldApplyStyleChangesToVisibleSnackbars on the @c defaultManager instance.
*/
Expand All @@ -407,4 +372,49 @@
+ (nullable UIColor *)buttonTitleColorForState:(UIControlState)state
__deprecated_msg("Use [MDCSnackbarManager.defaultManager buttonTitleColorForState:] instead.");

/**
Calls @c -resumeMessagesWithToken: on the @c defaultManager instance.
*/
+ (void)resumeMessagesWithToken:(nullable id<MDCSnackbarSuspensionToken>)token
__deprecated_msg("Use [MDCSnackbarManager.defaultManager resumeMessagesWithToken:] instead.");

/**
Calls @c -suspendAllMessages on the @c defaultManager instance.
*/
+ (nullable id<MDCSnackbarSuspensionToken>)suspendAllMessages __deprecated_msg(
"Use [MDCSnackbarManager.defaultManager suspendAllMessages] instead.");

/**
Calls @c -suspendMessagesWithCategory: on the @c defaultManager instance.
*/
+ (nullable id<MDCSnackbarSuspensionToken>)suspendMessagesWithCategory:(nullable NSString *)category
__deprecated_msg(
"Use [MDCSnackbarManager.defaultManager suspendMessagesWithCategory:] instead.");

/**
Calls @c -setButtonTitleColor:forState: on the @c defaultManager instance.
*/
+ (void)setButtonTitleColor:(nullable UIColor *)titleColor
forState:(UIControlState)state
__deprecated_msg(
"Use [MDCSnackbarManager.defaultManager setButtonTitleColor:forState:] instead.");

/**
Calls -setBottomOffset: on the @c defaultManager instance.
*/
+ (void)setBottomOffset:(CGFloat)offset
__deprecated_msg("Use [MDCSnackbarManager.defaultManager setBottomOffset:] instead.");

/**
Calls @c -hasMessagesShowingORQueued on the @c defaultManager instance.
*/
+ (BOOL)hasMessagesShowingOrQueued __deprecated_msg(
"Use [MDCSnackbarManager.defaultManager hasMessagesShowingOrQueued] instead.");

/**
Calls @c -setPresentationHostView: on the @c defaultManager instance.
*/
+ (void)setPresentationHostView:(nullable UIView *)hostView
__deprecated_msg("Use [MDCSnackbarManager.defaultManager setPresentationHostView:] instead.");

@end

0 comments on commit 8dc2768

Please sign in to comment.