Skip to content

Commit

Permalink
Allow customization of selection indicator
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 589867180
  • Loading branch information
Janette James authored and material-automation committed Dec 11, 2023
1 parent fa93c43 commit 976983f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
29 changes: 29 additions & 0 deletions components/BottomNavigation/src/MDCBottomNavigationBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,35 @@ typedef NS_ENUM(NSInteger, MDCBottomNavigationBarAlignment) {
*/
@property(nonatomic, strong, readwrite, nonnull) UIColor *selectedItemTitleColor;

/**
If @c YES, a pill-shaped "active indicator" is used to show which item is currently selected. The
active indicator is centered around the selected icon, and animates in/out when a new item is
selected.
Note that using the active indicator turns off any ink/ripple behavior, as they should not both be
used as an indication of selection of a new item.
Defaults to @c NO.
*/
@property(nonatomic, assign) BOOL showsSelectionIndicator;

/**
Size of the active indicator.
Only has an impact if @c useActiveIndicator is set to @c YES.
Defaults to 30, 60.
*/
@property(nonatomic, assign) CGSize selectionIndicatorSize;

/**
Background color for the active indicator. Only has an impact if @c useActiveIndicator is set to
@c YES.
Defaults to #C3D9F2.
*/
@property(nonatomic, strong, nonnull) UIColor *selectionIndicatorColor;

/**
Color of unselected items. Applies color to items' icons. Text is not displayed in unselected mode.
Default color is dark gray.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,4 @@

@property(nonatomic, readonly) BOOL isTitleBelowIcon;

// Selection indicator
@property(nonatomic, assign) BOOL showsSelectionIndicator;
@property(nonatomic, assign) CGSize selectionIndicatorSize;
@property(nonatomic, strong, nonnull) UIColor *selectionIndicatorColor;

@end

0 comments on commit 976983f

Please sign in to comment.