[Buttons] Create a separate class for MDCFloatingButton color themer.
Added MDCFloatingButtonColorThemer to color theme a floating button.
examples and tests are updated.
![screen shot 2018-04-20 at 1 14 17 pm](https://user-images.githubusercontent.com/36271115/39068266-baf19f22-44a9-11e8-9eaa-fe58d74dd804.png)
MODIFY
components/Buttons/examples/ButtonsTypicalUseExampleViewController.m
components/Buttons/examples/ButtonsTypicalUseExampleViewController.m
#import "MaterialButtons.h"
#import "MaterialTypography.h"
#import "MDCTextButtonThemer.h"
+#import "MDCFloatingButtonColorThemer.h"
#import "MDCContainedButtonThemer.h"
#import "supplemental/ButtonsTypicalUseSupplemental.h"
UIImage *plusImage =
[[UIImage imageNamed:@"Plus"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[self.floatingButton setImage:plusImage forState:UIControlStateNormal];
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme toFloatingButton:self.floatingButton];
+ [MDCFloatingButtonColorThemer applySemanticColorScheme:colorScheme toButton:self.floatingButton];
[self.floatingButton setTintColor:colorScheme.onSecondaryColor];
[self.view addSubview:self.floatingButton];

MODIFY
components/Buttons/examples/FloatingButtonExampleViewController.m
components/Buttons/examples/FloatingButtonExampleViewController.m
#import "MaterialButtons.h"
#import "MDCButtonColorThemer.h"
+#import "MDCFloatingButtonColorThemer.h"
@interface FloatingButtonExampleViewController : UIViewController
@property(nonatomic, strong) UILabel *iPadLabel;
[self.miniFloatingButton setMinimumSize:CGSizeMake(96, 40)
forShape:MDCFloatingButtonShapeMini
inMode:MDCFloatingButtonModeExpanded];
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme
- toFloatingButton:self.miniFloatingButton];
+ [MDCFloatingButtonColorThemer applySemanticColorScheme:colorScheme
+ toButton:self.miniFloatingButton];
[self.miniFloatingButton setTintColor:colorScheme.onSecondaryColor];
self.defaultFloatingButton = [[MDCFloatingButton alloc] init];
self.defaultFloatingButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.defaultFloatingButton setImage:plusImage forState:UIControlStateNormal];
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme
- toFloatingButton:self.defaultFloatingButton];
+ [MDCFloatingButtonColorThemer applySemanticColorScheme:colorScheme
+ toButton:self.defaultFloatingButton];
[self.defaultFloatingButton setTintColor:colorScheme.onSecondaryColor];
self.largeIconFloatingButton = [[MDCFloatingButton alloc] init];
[self.largeIconFloatingButton setContentEdgeInsets:UIEdgeInsetsMake(-6, -6, -6, 0)
forShape:MDCFloatingButtonShapeDefault
inMode:MDCFloatingButtonModeExpanded];
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme
- toFloatingButton:self.largeIconFloatingButton];
+ [MDCFloatingButtonColorThemer applySemanticColorScheme:colorScheme
+ toButton:self.largeIconFloatingButton];
[self.largeIconFloatingButton setTintColor:colorScheme.onSecondaryColor];
[self.view addSubview:self.iPadLabel];

MODIFY
components/Buttons/src/ColorThemer/MDCButtonColorThemer.h
components/Buttons/src/ColorThemer/MDCButtonColorThemer.h
/**
Applies a color scheme to theme to an MDCFloatingButton.
+ This method will soon be deprecated. Consider using MDCFloatingButtonColorThemer's
+ applySemanticColorScheme:toButton:
+
@param colorScheme The color scheme to apply to @c floatingButton.
@param floatingButton An MDCFloatingButton instance to apply a color scheme.
*/

MODIFY
components/Buttons/src/ColorThemer/MDCButtonColorThemer.m
components/Buttons/src/ColorThemer/MDCButtonColorThemer.m
toFlatButton:(nonnull MDCButton *)flatButton {
[MDCTextButtonColorThemer applySemanticColorScheme:colorScheme toButton:flatButton];
}
+
+ (void)applySemanticColorScheme:(nonnull id<MDCColorScheming>)colorScheme
toFloatingButton:(nonnull MDCFloatingButton *)floatingButton {
[self resetUIControlStatesForButtonTheming:floatingButton];

ADD
components/Buttons/src/ColorThemer/MDCFloatingButtonColorThemer.h
+/*
+ Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+#import "MaterialButtons.h"
+#import "MaterialColorScheme.h"
+
+/**
+ A color themer for a Material floating Button.
+ */
+@interface MDCFloatingButtonColorThemer : NSObject
+
+/**
+ Applies a color scheme to theme to an MDCFloatingButton.
+
+ @param colorScheme The color scheme to apply to @c floatingButton.
+ @param button An MDCFloatingButton instance to apply a color scheme.
+ */
++ (void)applySemanticColorScheme:(nonnull id<MDCColorScheming>)colorScheme
+ toButton:(nonnull MDCFloatingButton *)button;
+
+@end

ADD
components/Buttons/src/ColorThemer/MDCFloatingButtonColorThemer.m
+/*
+ Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+#import "MDCFloatingButtonColorThemer.h"
+
+@implementation MDCFloatingButtonColorThemer
+
++ (void)applySemanticColorScheme:(nonnull id<MDCColorScheming>)colorScheme
+ toButton:(nonnull MDCFloatingButton *)button {
+ [self resetUIControlStatesForButtonTheming:button];
+ [button setBackgroundColor:colorScheme.secondaryColor forState:UIControlStateNormal];
+ button.disabledAlpha = 1.f;
+}
+
++ (void)resetUIControlStatesForButtonTheming:(nonnull MDCButton *)button {
+ NSUInteger maximumStateValue = UIControlStateNormal | UIControlStateSelected |
+ UIControlStateHighlighted | UIControlStateDisabled;
+ for (NSUInteger state = 0; state <= maximumStateValue; ++state) {
+ [button setBackgroundColor:nil forState:state];
+ [button setTitleColor:nil forState:state];
+ }
+}
+
+@end

MODIFY
components/Buttons/tests/unit/ButtonsColorThemerTests.m
components/Buttons/tests/unit/ButtonsColorThemerTests.m
#import "MaterialButtons.h"
#import "MDCButtonColorThemer.h"
+#import "MDCFloatingButtonColorThemer.h"
#import "MDCTextButtonColorThemer.h"
#import "MDCContainedButtonColorThemer.h"
@@ -226,7 +227,7 @@ static const CGFloat kEpsilonAccuracy = 0.001f;
[button setBackgroundColor:UIColor.darkGrayColor forState:UIControlStateDisabled];
// Where
- [MDCButtonColorThemer applySemanticColorScheme:colorScheme toFloatingButton:button];
+ [MDCFloatingButtonColorThemer applySemanticColorScheme:colorScheme toButton:button];
// Then
NSUInteger maximumStateValue =

[Buttons] Create a separate class for MDCFloatingButton color themer. (#3429)

Added MDCFloatingButtonColorThemer to color theme a floating button.
examples and tests are updated.

![screen shot 2018-04-20 at 1 14 17 pm](https://user-images.githubusercontent.com/36271115/39068266-baf19f22-44a9-11e8-9eaa-fe58d74dd804.png)