Respect destination vaules in LayoutAnimation create
Reviewed By: nicklockwood Differential Revision: D2544389 fb-gh-sync-id: 9e6abdbd1f500578369e5f2c3e34d7f5ef047f5e
This commit is contained in:
parent
c0b5e6ed67
commit
1091ecd8e0
|
@ -526,6 +526,8 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
|
||||||
|
|
||||||
// Animate view creation
|
// Animate view creation
|
||||||
if (createAnimation) {
|
if (createAnimation) {
|
||||||
|
CATransform3D finalTransform = view.layer.transform;
|
||||||
|
CGFloat finalOpacity = view.layer.opacity;
|
||||||
if ([createAnimation.property isEqualToString:@"scaleXY"]) {
|
if ([createAnimation.property isEqualToString:@"scaleXY"]) {
|
||||||
view.layer.transform = CATransform3DMakeScale(0, 0, 0);
|
view.layer.transform = CATransform3DMakeScale(0, 0, 0);
|
||||||
} else if ([createAnimation.property isEqualToString:@"opacity"]) {
|
} else if ([createAnimation.property isEqualToString:@"opacity"]) {
|
||||||
|
@ -533,9 +535,9 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
|
||||||
}
|
}
|
||||||
[createAnimation performAnimations:^{
|
[createAnimation performAnimations:^{
|
||||||
if ([createAnimation.property isEqual:@"scaleXY"]) {
|
if ([createAnimation.property isEqual:@"scaleXY"]) {
|
||||||
view.layer.transform = CATransform3DIdentity;
|
view.layer.transform = finalTransform;
|
||||||
} else if ([createAnimation.property isEqual:@"opacity"]) {
|
} else if ([createAnimation.property isEqual:@"opacity"]) {
|
||||||
view.layer.opacity = 1.0;
|
view.layer.opacity = finalOpacity;
|
||||||
} else {
|
} else {
|
||||||
RCTLogError(@"Unsupported layout animation createConfig property %@",
|
RCTLogError(@"Unsupported layout animation createConfig property %@",
|
||||||
createAnimation.property);
|
createAnimation.property);
|
||||||
|
|
Loading…
Reference in New Issue