Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit f31562c

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 292e4cc + 432585f commit f31562c

38 files changed

+785
-518
lines changed

.jazzy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module: MotionAnimator
2-
module_version: 2.6.0
2+
module_version: 2.7.0
33
sdk: iphonesimulator
44
umbrella_header: src/MotionAnimator.h
55
objc: true
66
github_url: https://github.com/material-motion/motion-animator-objc
7-
github_file_prefix: https://github.com/material-motion/motion-animator-objc/tree/v2.6.0
7+
github_file_prefix: https://github.com/material-motion/motion-animator-objc/tree/v2.7.0

.kokoro

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,35 @@ set -e
2020
# Display commands to stderr.
2121
set -x
2222

23-
KOKORO_RUNNER_VERSION="v3.*"
23+
KOKORO_RUNNER_VERSION="v4.*"
24+
25+
POSITIONAL=()
26+
while [[ $# -gt 0 ]]; do
27+
key="$1"
28+
29+
case $key in
30+
-v|--verbose)
31+
VERBOSE_OUTPUT="1"
32+
shift
33+
;;
34+
*)
35+
POSITIONAL+=("$1")
36+
shift
37+
;;
38+
esac
39+
done
40+
set -- "${POSITIONAL[@]}" # restore positional parameters
41+
42+
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
43+
# Always enable verbose output on kokoro runs.
44+
VERBOSE_OUTPUT=1
45+
fi
46+
47+
if [ -n "$VERBOSE_OUTPUT" ]; then
48+
# Display commands to stderr.
49+
set -x
50+
verbosity_args="-v"
51+
fi
2452

2553
if [ ! -d .kokoro-ios-runner ]; then
2654
git clone https://github.com/material-foundation/kokoro-ios-runner.git .kokoro-ios-runner
@@ -33,6 +61,6 @@ TAG=$(git tag --sort=v:refname -l "$KOKORO_RUNNER_VERSION" | tail -n1)
3361
git checkout "$TAG" > /dev/null
3462
popd
3563

36-
./.kokoro-ios-runner/bazel.sh test //:UnitTests 8.1.0
64+
./.kokoro-ios-runner/bazel.sh test //:UnitTests --min-xcode-version 8.1.0 $verbosity_args
3765

3866
echo "Success!"

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ before_install:
66
- pod install --repo-update
77
script:
88
- set -o pipefail
9-
- xcodebuild build -workspace MotionAnimator.xcworkspace -scheme MotionAnimatorCatalog -sdk "iphonesimulator10.3" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c;
9+
- xcodebuild test -workspace MotionAnimator.xcworkspace -scheme MotionAnimatorCatalog -sdk "iphonesimulator10.3" -destination "name=iPhone 6s,OS=10.3.1" -enableCodeCoverage YES ONLY_ACTIVE_ARCH=YES | xcpretty -c;
1010
after_success:
1111
- bash <(curl -s https://codecov.io/bash)

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
# 2.7.0
2+
3+
This minor release introduces support for the new [v1.5.0](https://github.com/material-motion/motion-interchange-objc/releases/tag/v1.5.0) MotionInterchange format.
4+
5+
## New features
6+
7+
It is now possible to additively and implicitly animate the `transform` property of both UIView and CALayer.
8+
9+
## Source changes
10+
11+
* [Fix pre-iOS 11 unit test failure. (#89)](https://github.com/material-motion/motion-animator-objc/commit/7e506cc37b7d64d010b69d4996621755ece26595) (featherless)
12+
* [Migrate to the Objective-C interchange format (#88)](https://github.com/material-motion/motion-animator-objc/commit/573b19269e155f15e05e9b146a1c324b937cfb1c) (featherless)
13+
* [Revert "Update with ObjC implementation."](https://github.com/material-motion/motion-animator-objc/commit/f55625d9f63e857e878eff4e7687ddd40bad0fea) (Jeff Verkoeyen)
14+
* [Update with ObjC implementation.](https://github.com/material-motion/motion-animator-objc/commit/be7f9081c0678484e034cc976aafcdab748b58bf) (Jeff Verkoeyen)
15+
* [Add support for additively animating transform. (#85)](https://github.com/material-motion/motion-animator-objc/commit/e54ce3a118c1e877c5ca78a7d2fed9625d0ffc67) (featherless)
16+
17+
## API changes
18+
19+
Auto-generated by running:
20+
21+
apidiff origin/stable release-candidate objc src/MotionAnimator.h
22+
23+
#### MDMMotionAnimator
24+
25+
*new* method: `-animateWithTraits:animations:completion:` in `MDMMotionAnimator`
26+
27+
*new* method: `-animateWithTraits:between:layer:keyPath:` in `MDMMotionAnimator`
28+
29+
*new* method: `-animateWithTraits:animations:` in `MDMMotionAnimator`
30+
31+
*new* method: `-animateWithTraits:between:layer:keyPath:completion:` in `MDMMotionAnimator`
32+
33+
#### MDMKeyPathTransform
34+
35+
*new* constant: `MDMKeyPathTransform`
36+
37+
## Non-source changes
38+
39+
* [Update .travis.yml](https://github.com/material-motion/motion-animator-objc/commit/8f474dd545ec1b3e98db5ef783bca502351911e4) (featherless)
40+
* [Enable coverage on travis](https://github.com/material-motion/motion-animator-objc/commit/45d43aa23a88c963927f4f01669e1b0ae26fb9e5) (featherless)
41+
* [Update kokoro bazel runner for v4.](https://github.com/material-motion/motion-animator-objc/commit/67d903ed71fbc909ea06bb8097313a4218c8f566) (Jeff Verkoeyen)
42+
143
# 2.6.0
244

345
This minor release increases test coverage, fixes a variety of bugs related to `beginFromCurrentState`, and generally improves the stability and robustness of the underlying implementation.

MotionAnimator.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "MotionAnimator"
33
s.summary = "A Motion Animator creates performant, interruptible animations from motion specs."
4-
s.version = "2.6.0"
4+
s.version = "2.7.0"
55
s.authors = "The Material Motion Authors"
66
s.license = "Apache 2.0"
77
s.homepage = "https://github.com/material-motion/motion-animator-objc"
@@ -12,5 +12,5 @@ Pod::Spec.new do |s|
1212
s.public_header_files = "src/*.h"
1313
s.source_files = "src/*.{h,m,mm}", "src/private/*.{h,m,mm}"
1414

15-
s.dependency "MotionInterchange", "~> 1.3"
15+
s.dependency "MotionInterchange", "~> 1.6"
1616
end

Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
22
- CatalogByConvention (2.2.0)
3-
- MotionAnimator (2.6.0):
4-
- MotionInterchange (~> 1.3)
5-
- MotionInterchange (1.3.0)
3+
- MotionAnimator (2.7.0):
4+
- MotionInterchange (~> 1.6)
5+
- MotionInterchange (1.6.0)
66

77
DEPENDENCIES:
88
- CatalogByConvention
@@ -14,8 +14,8 @@ EXTERNAL SOURCES:
1414

1515
SPEC CHECKSUMS:
1616
CatalogByConvention: 5df5831e48b8083b18570dcb804f20fd1c90694f
17-
MotionAnimator: a4b0ba87a674bb3e89e25f0530b7e80a204ac1c1
18-
MotionInterchange: 988fc0011e4b806cc33f2fb4f9566f5eeb4159e8
17+
MotionAnimator: fe012f4b344f091f95a621b0d0a97c4e2ea1c525
18+
MotionInterchange: ead0e3ae1f3a5fb539e289debbc7ae036160a10d
1919

2020
PODFILE CHECKSUM: 3537bf01c11174928ac008c20fec4738722e96f3
2121

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ git_repository(
2727
git_repository(
2828
name = "motion_interchange_objc",
2929
remote = "https://github.com/material-motion/motion-interchange-objc.git",
30-
tag = "v1.3.0",
30+
tag = "v1.6.0",
3131
)

examples/CalendarCardExpansionExample.m

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
#import "MotionAnimator.h"
2222

23-
// This example demonstrates how to use a motion timing specification to build a complex
23+
// This example demonstrates how to use a motion traits specification to build a complex
2424
// bi-directional animation using the MDMMotionAnimator object. MDMMotionAnimator is designed for
2525
// building fine-tuned explicit animations. Unlike UIView's implicit animation API, which can be
2626
// used to cause cascading animations on a variety of properties, MDMMotionAnimator will always add
2727
// exactly one animation per key path to the layer. This means you don't get as much for "free", but
28-
// you do gain more control over the timing and motion of the animation.
28+
// you do gain more control over the traits and motion of the animation.
2929

3030
@implementation CalendarCardExpansionExampleViewController {
3131
// In a real-world scenario we'd likely create a separate view to manage all of these subviews so
@@ -40,81 +40,83 @@ @implementation CalendarCardExpansionExampleViewController {
4040
- (void)didTap {
4141
_expanded = !_expanded;
4242

43-
CalendarChipTiming timing = (_expanded
44-
? CalendarChipMotionSpec.expansion
45-
: CalendarChipMotionSpec.collapse);
43+
id<CalendarChipTiming> traits = (_expanded
44+
? CalendarChipMotionSpec.expansion
45+
: CalendarChipMotionSpec.collapse);
4646

4747
MDMMotionAnimator *animator = [[MDMMotionAnimator alloc] init];
4848
animator.shouldReverseValues = !_expanded;
4949
animator.beginFromCurrentState = YES;
5050

51-
[animator animateWithTiming:timing.navigationBarY animations:^{
51+
[animator animateWithTraits:traits.navigationBarY animations:^{
5252
[self.navigationController setNavigationBarHidden:_expanded animated:YES];
5353
}];
5454

5555
CGRect chipFrame = [self frameForChip];
5656
CGRect headerFrame = [self frameForHeader];
5757

5858
// Animate the chip itself.
59-
[animator animateWithTiming:timing.chipHeight
60-
toLayer:_chipView.layer
61-
withValues:@[ @(chipFrame.size.height), @(headerFrame.size.height) ]
59+
[animator animateWithTraits:traits.chipHeight
60+
between:@[ @(chipFrame.size.height), @(headerFrame.size.height) ]
61+
layer:_chipView.layer
6262
keyPath:MDMKeyPathHeight];
63-
[animator animateWithTiming:timing.chipWidth
64-
toLayer:_chipView.layer
65-
withValues:@[ @(chipFrame.size.width), @(headerFrame.size.width) ]
63+
[animator animateWithTraits:traits.chipWidth
64+
between:@[ @(chipFrame.size.width), @(headerFrame.size.width) ]
65+
layer:_chipView.layer
6666
keyPath:MDMKeyPathWidth];
67-
[animator animateWithTiming:timing.chipWidth
68-
toLayer:_chipView.layer
69-
withValues:@[ @(CGRectGetMidX(chipFrame)), @(CGRectGetMidX(headerFrame)) ]
67+
[animator animateWithTraits:traits.chipWidth
68+
between:@[ @(CGRectGetMidX(chipFrame)), @(CGRectGetMidX(headerFrame)) ]
69+
layer:_chipView.layer
7070
keyPath:MDMKeyPathX];
71-
[animator animateWithTiming:timing.chipY
72-
toLayer:_chipView.layer
73-
withValues:@[ @(CGRectGetMidY(chipFrame)), @(CGRectGetMidY(headerFrame)) ]
71+
[animator animateWithTraits:traits.chipY
72+
between:@[ @(CGRectGetMidY(chipFrame)), @(CGRectGetMidY(headerFrame)) ]
73+
layer:_chipView.layer
7474
keyPath:MDMKeyPathY];
75-
[animator animateWithTiming:timing.chipHeight
76-
toLayer:_chipView.layer
77-
withValues:@[ @([self chipCornerRadius]), @0 ]
75+
[animator animateWithTraits:traits.chipHeight
76+
between:@[ @([self chipCornerRadius]), @0 ]
77+
layer:_chipView.layer
7878
keyPath:MDMKeyPathCornerRadius];
7979

8080
// Cross-fade the chip's contents.
81-
[animator animateWithTiming:timing.chipContentOpacity
82-
toLayer:_collapsedContent.layer
83-
withValues:@[ @1, @0 ]
81+
[animator animateWithTraits:traits.chipContentOpacity
82+
between:@[ @1, @0 ]
83+
layer:_collapsedContent.layer
8484
keyPath:MDMKeyPathOpacity];
85-
[animator animateWithTiming:timing.headerContentOpacity
86-
toLayer:_expandedContent.layer
87-
withValues:@[ @0, @1 ]
85+
[animator animateWithTraits:traits.headerContentOpacity
86+
between:@[ @0, @1 ]
87+
layer:_expandedContent.layer
8888
keyPath:MDMKeyPathOpacity];
8989

9090
// Keeps the expandec content aligned to the bottom of the card by taking into consideration the
9191
// extra height.
9292
CGFloat excessTopMargin = chipFrame.size.height - headerFrame.size.height;
93-
[animator animateWithTiming:timing.chipHeight
94-
toLayer:_expandedContent.layer
95-
withValues:@[ @(CGRectGetMidY([self expandedContentFrame]) + excessTopMargin),
93+
[animator animateWithTraits:traits.chipHeight
94+
between:@[ @(CGRectGetMidY([self expandedContentFrame]) + excessTopMargin),
9695
@(CGRectGetMidY([self expandedContentFrame])) ]
96+
layer:_expandedContent.layer
9797
keyPath:MDMKeyPathY];
9898

9999
// Keeps the collapsed content aligned to its position on screen by taking into consideration the
100100
// excess left margin.
101101
CGFloat excessLeftMargin = chipFrame.origin.x - headerFrame.origin.x;
102-
[animator animateWithTiming:timing.chipWidth
103-
toLayer:_collapsedContent.layer
104-
withValues:@[ @(CGRectGetMidX([self collapsedContentFrame])),
102+
[animator animateWithTraits:traits.chipWidth
103+
between:@[ @(CGRectGetMidX([self collapsedContentFrame])),
105104
@(CGRectGetMidX([self collapsedContentFrame]) + excessLeftMargin) ]
105+
layer:_collapsedContent.layer
106106
keyPath:MDMKeyPathX];
107107

108108
// Keeps the shape anchored to the bottom right of the chip.
109109
CGRect shapeFrameInChip = [self shapeFrameInRect:chipFrame];
110110
CGRect shapeFrameInHeader = [self shapeFrameInRect:headerFrame];
111-
[animator animateWithTiming:timing.chipWidth
112-
toLayer:_shapeView.layer
113-
withValues:@[ @(CGRectGetMidX(shapeFrameInChip)), @(CGRectGetMidX(shapeFrameInHeader)) ]
111+
[animator animateWithTraits:traits.chipWidth
112+
between:@[ @(CGRectGetMidX(shapeFrameInChip)),
113+
@(CGRectGetMidX(shapeFrameInHeader)) ]
114+
layer:_shapeView.layer
114115
keyPath:MDMKeyPathX];
115-
[animator animateWithTiming:timing.chipHeight
116-
toLayer:_shapeView.layer
117-
withValues:@[ @(CGRectGetMidY(shapeFrameInChip)), @(CGRectGetMidY(shapeFrameInHeader)) ]
116+
[animator animateWithTraits:traits.chipHeight
117+
between:@[ @(CGRectGetMidY(shapeFrameInChip)),
118+
@(CGRectGetMidY(shapeFrameInHeader)) ]
119+
layer:_shapeView.layer
118120
keyPath:MDMKeyPathY];
119121
}
120122

examples/CalendarChipMotionSpec.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,26 @@
1717
#import <Foundation/Foundation.h>
1818
#import <MotionInterchange/MotionInterchange.h>
1919

20-
typedef struct CalendarChipTiming {
21-
MDMMotionTiming chipWidth;
22-
MDMMotionTiming chipHeight;
23-
MDMMotionTiming chipY;
20+
@protocol CalendarChipTiming <NSObject>
2421

25-
MDMMotionTiming chipContentOpacity;
26-
MDMMotionTiming headerContentOpacity;
22+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipWidth;
23+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipHeight;
24+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipY;
2725

28-
MDMMotionTiming navigationBarY;
29-
} CalendarChipTiming;
26+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *chipContentOpacity;
27+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *headerContentOpacity;
28+
29+
@property(nonatomic, strong, nonnull, readonly) MDMAnimationTraits *navigationBarY;
30+
31+
@end
3032

3133
@interface CalendarChipMotionSpec: NSObject
3234

33-
@property(nonatomic, class, readonly) CalendarChipTiming expansion;
34-
@property(nonatomic, class, readonly) CalendarChipTiming collapse;
35+
@property(nonatomic, class, strong, nonnull, readonly) id<CalendarChipTiming> expansion;
36+
@property(nonatomic, class, strong, nonnull, readonly) id<CalendarChipTiming> collapse;
3537

3638
// This object is not meant to be instantiated.
37-
- (instancetype)init NS_UNAVAILABLE;
39+
- (nonnull instancetype)init NS_UNAVAILABLE;
3840

3941
@end
4042

0 commit comments

Comments
 (0)