Skip to content

Commit

Permalink
chore: improve Android 13 animations (#1756)
Browse files Browse the repository at this point in the history
## Description

New Android animations introduced in
software-mansion/react-native-screens#1693 were
laggy (especially enter-out / enter-in animations).

This was caused by [these
lines](https://cs.android.com/android/platform/superproject/+/android-platform-13.0.0_r6:frameworks/base/core/res/res/anim/activity_open_exit.xml;l=23-24)
in Android source code -- alpha was not animated.

## Changes

Set more reasonable target value for alpha animation & explicitly set
start offset on enter out animation.



## Test code and steps to reproduce

See #1693 for description.

## Checklist

- [x] Ensured that CI passes (Android e2e do fail for unrelated reasons)
  • Loading branch information
kkafar authored Apr 13, 2023
1 parent b9239d8 commit df69cd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion android/src/main/res/v33/anim-v33/rns_default_enter_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:shareInterpolator="false">

<alpha
android:fromAlpha="0"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:fillEnabled="true"
android:fillBefore="true"
Expand All @@ -19,6 +19,7 @@
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:startOffset="0"
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
android:duration="450" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<alpha
android:fromAlpha="1.0"
android:toAlpha="1.0"
android:toAlpha="0.0"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
Expand Down

0 comments on commit df69cd6

Please sign in to comment.