Skip to content

Commit 5393ade

Browse files
committed
Merge branch 'develop' into button
2 parents fabf5af + c2e207c commit 5393ade

27 files changed

+611
-554
lines changed

components/Buttons/src/MDCButton.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919

2020
/**
2121
A Material flat, raised or floating button.
22-
22+
2323
All buttons display animated ink splashes when the user interacts with the button.
24-
24+
2525
The title color of the button set to have an accessible contrast ratio with the button's
2626
background color. To ensure this works for flat buttons (with transparent background), the caller
2727
is responsible for setting (and updating, if necessary) the button's underlyingColor property.
28-
28+
2929
All buttons set the exclusiveTouch property to YES by default, which prevents users from
3030
simultaneously interacting with a button and other UI elements.
31-
31+
3232
@see http://www.google.com/design/spec/components/buttons.html
3333
*/
3434
@interface MDCButton : UIButton

components/Buttons/src/MDCFlatButton.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020

2121
/**
2222
A "flat" MDCButton.
23-
23+
2424
Flat buttons should be considered the default button. They do not have its own background color
2525
and do not raise when touched. This type of button should be used in most situations requiring a
2626
button. For layouts with many UI elements in which a flat button might get visually lost,
2727
consider using a MDCRaisedButton instead.
28-
28+
2929
@see http://www.google.com/design/spec/components/buttons.html#buttons-flat-buttons
3030
*/
3131
@interface MDCFlatButton : MDCButton
3232

3333
/**
3434
Use an opaque background color (default is NO).
35-
35+
3636
Flat buttons normally have a transparent background and blend seamlessly with their underlying
3737
color, but occasionally a flat button with an opaque background will be required. Consider using
3838
a raised button instead if possible.

components/Buttons/src/MDCRaisedButton.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
/**
2020
A "raised" MDCButton.
21-
21+
2222
Raised buttons have their own background color, float above their parent slightly, and raise
2323
briefly when touched. Raised buttons should be used when flat buttons would get lost among other
2424
UI elements on the screen.
25-
25+
2626
@see http://www.google.com/design/spec/components/buttons.html#buttons-raised-buttons
2727
*/
2828
@interface MDCRaisedButton : MDCButton

components/Ink/src/private/MDCInkLayer.m

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,20 @@ - (void)endBackgroundRipple {
243243
if (!opacityVal) {
244244
opacityVal = [NSNumber numberWithFloat:0];
245245
}
246-
247-
// The end (tap release) animation should continue at the opacity level of the start animation.
248-
CGFloat enterDuration = (1 - opacityVal.floatValue / _maxOpacityLevel) *
249-
kMDCInkLayerFastEnterDuration;
250-
CGFloat duration = kMDCInkLayerBaseOpacityExitDuration + enterDuration;
251-
_backgroundOpacityAnim =
252-
[self opacityAnimWithValues:@[ opacityVal, @(_maxOpacityLevel), @0 ]
253-
times:@[ @0, @(enterDuration / duration), @1.f ]];
246+
CGFloat duration = kMDCInkLayerBaseOpacityExitDuration;
247+
if ([self isBounded]) {
248+
// The end (tap release) animation should continue at the opacity level of the start animation.
249+
CGFloat enterDuration = (1 - opacityVal.floatValue / _maxOpacityLevel) *
250+
kMDCInkLayerFastEnterDuration;
251+
duration += enterDuration;
252+
_backgroundOpacityAnim =
253+
[self opacityAnimWithValues:@[ opacityVal, @(_maxOpacityLevel), @0 ]
254+
times:@[ @0, @(enterDuration / duration), @1.f ]];
255+
} else {
256+
_backgroundOpacityAnim =
257+
[self opacityAnimWithValues:@[ opacityVal, @0 ]
258+
times:@[ @0, @1.f ]];
259+
}
254260
_backgroundOpacityAnim.duration = duration;
255261
[_backgroundRippleLayer addAnimation:_backgroundOpacityAnim
256262
forKey:kMDCInkLayerBackgroundOpacityAnim];

components/Slider/src/MDCSlider.m

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,47 @@ @implementation MDCSlider {
3636
- (instancetype)initWithFrame:(CGRect)frame {
3737
self = [super initWithFrame:frame];
3838
if (self) {
39-
CGRect trackFrame = CGRectInset(frame, 8.f, 0.f);
40-
41-
_thumbTrack = [[MDCThumbTrack alloc] initWithFrame:trackFrame onTintColor:[[self class] defaultColor]];
42-
_thumbTrack.delegate = self;
43-
_thumbTrack.disabledTrackHasThumbGaps = YES;
44-
_thumbTrack.trackEndsAreInset = YES;
45-
_thumbTrack.thumbRadius = kSliderThumbRadius;
46-
_thumbTrack.thumbMaxRippleRadius = kSliderThumbMaxRippleRadius;
47-
_thumbTrack.trackOffColor = [[self class] defaultTrackOffColor];
48-
[_thumbTrack addTarget:self
49-
action:@selector(thumbTrackValueChanged:)
50-
forControlEvents:UIControlEventValueChanged];
51-
[_thumbTrack addTarget:self
52-
action:@selector(thumbTrackTouchDown:)
53-
forControlEvents:UIControlEventTouchDown];
54-
[_thumbTrack addTarget:self
55-
action:@selector(thumbTrackTouchUpInside:)
56-
forControlEvents:UIControlEventTouchUpInside];
57-
[_thumbTrack addTarget:self
58-
action:@selector(thumbTrackTouchUpOutside:)
59-
forControlEvents:UIControlEventTouchUpOutside];
60-
[_thumbTrack addTarget:self
61-
action:@selector(thumbTrackTouchCanceled:)
62-
forControlEvents:UIControlEventTouchCancel];
63-
[self addSubview:_thumbTrack];
39+
[self commonInit];
6440
}
6541
return self;
6642
}
6743

44+
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
45+
self = [super initWithCoder:aDecoder];
46+
if (self) {
47+
[self commonInit];
48+
}
49+
return self;
50+
}
51+
52+
- (void)commonInit {
53+
CGRect trackFrame = CGRectInset(self.frame, 8.f, 0.f);
54+
55+
_thumbTrack = [[MDCThumbTrack alloc] initWithFrame:trackFrame onTintColor:[[self class] defaultColor]];
56+
_thumbTrack.delegate = self;
57+
_thumbTrack.disabledTrackHasThumbGaps = YES;
58+
_thumbTrack.trackEndsAreInset = YES;
59+
_thumbTrack.thumbRadius = kSliderThumbRadius;
60+
_thumbTrack.thumbMaxRippleRadius = kSliderThumbMaxRippleRadius;
61+
_thumbTrack.trackOffColor = [[self class] defaultTrackOffColor];
62+
[_thumbTrack addTarget:self
63+
action:@selector(thumbTrackValueChanged:)
64+
forControlEvents:UIControlEventValueChanged];
65+
[_thumbTrack addTarget:self
66+
action:@selector(thumbTrackTouchDown:)
67+
forControlEvents:UIControlEventTouchDown];
68+
[_thumbTrack addTarget:self
69+
action:@selector(thumbTrackTouchUpInside:)
70+
forControlEvents:UIControlEventTouchUpInside];
71+
[_thumbTrack addTarget:self
72+
action:@selector(thumbTrackTouchUpOutside:)
73+
forControlEvents:UIControlEventTouchUpOutside];
74+
[_thumbTrack addTarget:self
75+
action:@selector(thumbTrackTouchCanceled:)
76+
forControlEvents:UIControlEventTouchCancel];
77+
[self addSubview:_thumbTrack];
78+
}
79+
6880
#pragma mark - ThumbTrack passthrough methods
6981

7082
- (void)setTrackBackgroundColor:(UIColor *)trackBackgroundColor {

demos/Pesto/Pesto.xcodeproj/project.pbxproj

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
C91F6A501C63A80F00EB4BA8 /* PestoRemoteImageService.m in Sources */ = {isa = PBXBuildFile; fileRef = C91F6A4F1C63A80F00EB4BA8 /* PestoRemoteImageService.m */; };
1212
C9A8552B1C4EDFAA003CADF7 /* PestoSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A8552A1C4EDFAA003CADF7 /* PestoSettingsViewController.m */; };
1313
CE6A9B25D9A958C060ABB21D /* libPods-Pesto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B0D8C7972AFCDCD5C9447F8E /* libPods-Pesto.a */; };
14+
DE3620651C73A0850026DF5D /* PestoCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE3620641C73A0850026DF5D /* PestoCollectionViewController.m */; };
1415
DE381E1A1C457CEE00019C1D /* PestoCardCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DE381E191C457CEE00019C1D /* PestoCardCollectionViewCell.m */; };
1516
DE381E401C45A9FB00019C1D /* PestoSideView.m in Sources */ = {isa = PBXBuildFile; fileRef = DE381E3F1C45A9FB00019C1D /* PestoSideView.m */; };
1617
DE5EF8671C404E0E00D2D4B9 /* PestoDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DE5EF8661C404E0E00D2D4B9 /* PestoDetailViewController.m */; };
18+
DEA791031C751D0D006301CC /* PestoData.m in Sources */ = {isa = PBXBuildFile; fileRef = DEA791021C751D0D006301CC /* PestoData.m */; };
19+
DEA791051C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DEA791041C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m */; };
1720
DEBEDF291C3EF5D5004B614B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DEBEDF281C3EF5D5004B614B /* main.m */; };
1821
DEBEDF2C1C3EF5D5004B614B /* PestoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DEBEDF2B1C3EF5D5004B614B /* PestoAppDelegate.m */; };
19-
DEBEDF2F1C3EF5D5004B614B /* PestoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DEBEDF2E1C3EF5D5004B614B /* PestoViewController.m */; };
2022
DEBEDF321C3EF5D5004B614B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DEBEDF301C3EF5D5004B614B /* Main.storyboard */; };
2123
DEBEDF341C3EF5D5004B614B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DEBEDF331C3EF5D5004B614B /* Assets.xcassets */; };
2224
DEBEDF371C3EF5D5004B614B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DEBEDF351C3EF5D5004B614B /* LaunchScreen.storyboard */; };
@@ -32,18 +34,22 @@
3234
C9A855291C4EDFAA003CADF7 /* PestoSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PestoSettingsViewController.h; sourceTree = "<group>"; };
3335
C9A8552A1C4EDFAA003CADF7 /* PestoSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoSettingsViewController.m; sourceTree = "<group>"; };
3436
D36B00D81356A416449940A7 /* Pods-Pesto.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Pesto.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Pesto/Pods-Pesto.debug.xcconfig"; sourceTree = "<group>"; };
37+
DE3620631C73A0710026DF5D /* PestoCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoCollectionViewController.h; sourceTree = "<group>"; };
38+
DE3620641C73A0850026DF5D /* PestoCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoCollectionViewController.m; sourceTree = "<group>"; };
3539
DE381E181C457CE300019C1D /* PestoCardCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoCardCollectionViewCell.h; sourceTree = "<group>"; };
3640
DE381E191C457CEE00019C1D /* PestoCardCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoCardCollectionViewCell.m; sourceTree = "<group>"; };
3741
DE381E3E1C45A9FB00019C1D /* PestoSideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PestoSideView.h; sourceTree = "<group>"; };
3842
DE381E3F1C45A9FB00019C1D /* PestoSideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoSideView.m; sourceTree = "<group>"; };
3943
DE5EF8651C404DFD00D2D4B9 /* PestoDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoDetailViewController.h; sourceTree = "<group>"; };
4044
DE5EF8661C404E0E00D2D4B9 /* PestoDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoDetailViewController.m; sourceTree = "<group>"; };
45+
DEA791011C751D00006301CC /* PestoData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoData.h; sourceTree = "<group>"; };
46+
DEA791021C751D0D006301CC /* PestoData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoData.m; sourceTree = "<group>"; };
47+
DEA791041C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PestoFlexibleHeaderContainerViewController.m; sourceTree = "<group>"; };
48+
DEA791061C752B74006301CC /* PestoFlexibleHeaderContainerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoFlexibleHeaderContainerViewController.h; sourceTree = "<group>"; };
4149
DEBEDF241C3EF5D5004B614B /* Pesto.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pesto.app; sourceTree = BUILT_PRODUCTS_DIR; };
4250
DEBEDF281C3EF5D5004B614B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4351
DEBEDF2A1C3EF5D5004B614B /* PestoAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoAppDelegate.h; sourceTree = "<group>"; };
4452
DEBEDF2B1C3EF5D5004B614B /* PestoAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PestoAppDelegate.m; sourceTree = "<group>"; };
45-
DEBEDF2D1C3EF5D5004B614B /* PestoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PestoViewController.h; sourceTree = "<group>"; };
46-
DEBEDF2E1C3EF5D5004B614B /* PestoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PestoViewController.m; sourceTree = "<group>"; };
4753
DEBEDF311C3EF5D5004B614B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4854
DEBEDF331C3EF5D5004B614B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4955
DEBEDF361C3EF5D5004B614B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -112,15 +118,19 @@
112118
DE5EF8661C404E0E00D2D4B9 /* PestoDetailViewController.m */,
113119
DE381E3E1C45A9FB00019C1D /* PestoSideView.h */,
114120
DE381E3F1C45A9FB00019C1D /* PestoSideView.m */,
115-
DEBEDF2D1C3EF5D5004B614B /* PestoViewController.h */,
116-
DEBEDF2E1C3EF5D5004B614B /* PestoViewController.m */,
117121
C9A855291C4EDFAA003CADF7 /* PestoSettingsViewController.h */,
118122
C9A8552A1C4EDFAA003CADF7 /* PestoSettingsViewController.m */,
119123
C91F6A481C62BC0400EB4BA8 /* PestoAvatarView.h */,
120124
C91F6A491C62BC0400EB4BA8 /* PestoAvatarView.m */,
121125
C91F6A4E1C63A80F00EB4BA8 /* PestoRemoteImageService.h */,
122126
C91F6A4F1C63A80F00EB4BA8 /* PestoRemoteImageService.m */,
127+
DEA791011C751D00006301CC /* PestoData.h */,
128+
DEA791021C751D0D006301CC /* PestoData.m */,
123129
DEBEDF271C3EF5D5004B614B /* Supporting Files */,
130+
DE3620631C73A0710026DF5D /* PestoCollectionViewController.h */,
131+
DE3620641C73A0850026DF5D /* PestoCollectionViewController.m */,
132+
DEA791061C752B74006301CC /* PestoFlexibleHeaderContainerViewController.h */,
133+
DEA791041C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m */,
124134
);
125135
path = Pesto;
126136
sourceTree = "<group>";
@@ -254,15 +264,17 @@
254264
isa = PBXSourcesBuildPhase;
255265
buildActionMask = 2147483647;
256266
files = (
267+
DE3620651C73A0850026DF5D /* PestoCollectionViewController.m in Sources */,
257268
C91F6A501C63A80F00EB4BA8 /* PestoRemoteImageService.m in Sources */,
269+
DEA791051C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m in Sources */,
258270
C9A8552B1C4EDFAA003CADF7 /* PestoSettingsViewController.m in Sources */,
259271
C91F6A4A1C62BC0400EB4BA8 /* PestoAvatarView.m in Sources */,
260-
DEBEDF2F1C3EF5D5004B614B /* PestoViewController.m in Sources */,
261272
DE381E1A1C457CEE00019C1D /* PestoCardCollectionViewCell.m in Sources */,
262273
DE5EF8671C404E0E00D2D4B9 /* PestoDetailViewController.m in Sources */,
263274
DEBEDF2C1C3EF5D5004B614B /* PestoAppDelegate.m in Sources */,
264275
DE381E401C45A9FB00019C1D /* PestoSideView.m in Sources */,
265276
DEBEDF291C3EF5D5004B614B /* main.m in Sources */,
277+
DEA791031C751D0D006301CC /* PestoData.m in Sources */,
266278
);
267279
runOnlyForDeploymentPostprocessing = 0;
268280
};

demos/Pesto/Pesto/Assets.xcassets/PestoLogoLarge.imageset/Contents.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"images" : [
33
{
44
"idiom" : "universal",
5-
"filename" : "pesto_large_logo.pdf",
65
"scale" : "1x"
76
},
87
{
@@ -20,4 +19,4 @@
2019
"version" : 1,
2120
"author" : "xcode"
2221
}
23-
}
22+
}
Binary file not shown.

demos/Pesto/Pesto/Assets.xcassets/PestoLogoSmall.imageset/Contents.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"images" : [
33
{
44
"idiom" : "universal",
5-
"filename" : "pesto_small_logo.pdf",
65
"scale" : "1x"
76
},
87
{
@@ -20,4 +19,4 @@
2019
"version" : 1,
2120
"author" : "xcode"
2221
}
23-
}
22+
}
Binary file not shown.

0 commit comments

Comments
 (0)