[Catalog] Bottom App bar should theme the FAB Button.
* Bottom App bar should theme the FAB Button,
View should not be loaded in init,
Scheme properties are added.
* lf, header name.
MODIFY
components/BottomAppBar/examples/BottomAppBarTypicalUseExample.m
components/BottomAppBar/examples/BottomAppBarTypicalUseExample.m
#import <UIKit/UIKit.h>
#import "MaterialBottomAppBar.h"
-#import "MaterialButtons+ColorThemer.h"
+#import "MaterialButtons+ButtonThemer.h"
#import "supplemental/BottomAppBarTypicalUseSupplemental.h"
+@interface BottomAppBarTypicalUseExample ()
+
+@property(nonatomic, strong) MDCSemanticColorScheme *colorScheme;
+@property(nonatomic, strong) MDCTypographyScheme *typographyScheme;
+
+@end
+
@implementation BottomAppBarTypicalUseExample
- (id)init {
self = [super init];
if (self) {
self.title = @"Bottom App Bar";
- [self commonBottomBarTypicalUseExampleInit];
}
return self;
}
-- (void)commonBottomBarTypicalUseExampleInit {
+- (void)commonBottomBarSetup {
[self setupExampleTableLayout];
// Add touch handler to the floating button.
forControlEvents:UIControlEventTouchUpInside];
// Set the image on the floating button.
- UIImage *addImage = [UIImage imageNamed:@"Add"];
+ UIImage *addImage =
+ [[UIImage imageNamed:@"Add"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[self.bottomBarView.floatingButton setImage:addImage forState:UIControlStateNormal];
- // Theme the floating button.
- MDCSemanticColorScheme *colorScheme = [[MDCSemanticColorScheme alloc] init];
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme
- toFloatingButton:self.bottomBarView.floatingButton];
-
// Configure the navigation buttons to be shown on the bottom app bar.
UIBarButtonItem *barButtonLeadingItem =
[[UIBarButtonItem alloc] initWithTitle:nil
[self.bottomBarView setTrailingBarButtonItems:@[ barButtonTrailingItem ]];
}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ [self commonBottomBarSetup];
+
+ MDCButtonScheme *buttonScheme = [[MDCButtonScheme alloc] init];
+ buttonScheme.colorScheme = self.colorScheme;
+ buttonScheme.typographyScheme = self.typographyScheme;
+ [MDCFloatingActionButtonThemer applyScheme:buttonScheme
+ toButton:self.bottomBarView.floatingButton];
+}
- (void)didTapFloatingButton:(id)sender {
[self.bottomBarView setFloatingButtonHidden:YES animated:YES];
}

MODIFY
components/BottomAppBar/examples/supplemental/BottomAppBarTypicalUseViewController.m
components/BottomAppBar/examples/supplemental/BottomAppBarTypicalUseViewController.m
@implementation BottomAppBarTypicalUseViewController
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
- self = [super initWithCoder:aDecoder];
- if (self) {
- [self commonMDCBottomAppBarViewControllerInit];
- }
- return self;
-}
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- [self commonMDCBottomAppBarViewControllerInit];
- }
- return self;
-}
-
-- (void)commonMDCBottomAppBarViewControllerInit {
+- (void)commonMDCBottomAppBarViewControllerSetup {
_bottomBarView = [[MDCBottomAppBarView alloc] initWithFrame:CGRectZero];
_bottomBarView.autoresizingMask =
(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin);
_bottomBarView.frame = bottomBarViewFrame;
}
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ [self commonMDCBottomAppBarViewControllerSetup];
+}
+
+
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
[self layoutBottomAppBar];

[Catalog] Bottom App bar should theme the FAB Button. (#3740)

* Bottom App bar should theme the FAB Button,
View should not be loaded in init,
Scheme properties are added.

* lf, header name.

https://github.com/material-components/material-components-ios/pull/3740