Skip to content

Commit

Permalink
Updates the button's width and height dynamically to adjust for long …
Browse files Browse the repository at this point in the history
…text and larger font sizes.

Update the TextView height to fit large text sizes and larger font sizes.
This CL is for rolling back previous CL(cl/684841697).

PiperOrigin-RevId: 706639834
  • Loading branch information
Nobody authored and material-automation committed Dec 16, 2024
1 parent 610c257 commit 554b1f5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 86 deletions.
15 changes: 13 additions & 2 deletions components/Banner/src/MDCBannerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#import "MDCMinimumOS.h" // IWYU pragma: keep

#import "MDCElevatable.h" // ComponentImport
#import "MDCElevationOverriding.h" // ComponentImport
#import "MaterialElevation.h" // ComponentImport

#import <UIKit/UIKit.h>
#import "MaterialButtons.h" // ComponentImport
#import "MaterialElevation.h" // ComponentImport
Expand Down Expand Up @@ -42,8 +46,9 @@ typedef NS_ENUM(NSInteger, MDCBannerViewLayoutStyle) {
The [Material Guideline](https://material.io/design/components/banners.html) has more details on
component usage.
*/
__attribute__((objc_subclassing_restricted)) @interface MDCBannerView
: UIView<MDCElevatable, MDCElevationOverriding>
__attribute__((objc_subclassing_restricted))
@interface MDCBannerView
: UIView<MDCElevatable, MDCElevationOverriding, UIContentSizeCategoryAdjusting>
#pragma clang diagnostic pop

/**
Expand Down Expand Up @@ -148,6 +153,12 @@ __attribute__((objc_subclassing_restricted)) @interface MDCBannerView
*/
@property(nonatomic, readonly) BOOL isM3CButtonEnabled;

/**
A Boolean that indicates whether the object automatically updates its font when the device’s
content size category changes.
*/
@property(nonatomic, readwrite, assign) BOOL adjustsFontForContentSizeCategory;

/** Initializes the @c MDCBannerView to be compatible with M3. This
* means using @c M3CButton instead of @c MDCButton for @c leadingButton and
* @c trailingButton.
Expand Down
Loading

0 comments on commit 554b1f5

Please sign in to comment.