Loading core/java/com/android/internal/policy/TransitionAnimation.java +25 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,10 @@ public class TransitionAnimation { private static final String DEFAULT_PACKAGE = "android"; // TODO (b/215515255): remove once we full migrate to shell transitions private static final boolean SHELL_TRANSITIONS_ENABLED = SystemProperties.getBoolean("persist.debug.shell_transit", false); private final Context mContext; private final String mTag; Loading Loading @@ -252,6 +256,9 @@ public class TransitionAnimation { resId = ent.array.getResourceId(animAttr, 0); } } if (!SHELL_TRANSITIONS_ENABLED) { resId = updateToLegacyIfNeeded(resId); } resId = updateToTranslucentAnimIfNeeded(resId, transit); if (ResourceId.isValid(resId)) { return loadAnimationSafely(context, resId, mTag); Loading @@ -259,6 +266,24 @@ public class TransitionAnimation { return null; } /** * Replace animations that are not compatible with the legacy transition system with ones that * are compatible with it. * TODO (b/215515255): remove once we full migrate to shell transitions */ private int updateToLegacyIfNeeded(int anim) { if (anim == R.anim.activity_open_enter) { return R.anim.activity_open_enter_legacy; } else if (anim == R.anim.activity_open_exit) { return R.anim.activity_open_exit_legacy; } else if (anim == R.anim.activity_close_enter) { return R.anim.activity_close_enter_legacy; } else if (anim == R.anim.activity_close_exit) { return R.anim.activity_close_exit_legacy; } return anim; } /** Load animation by attribute Id from a specific AnimationStyle resource. */ @Nullable public Animation loadAnimationAttr(String packageName, int animStyleResId, int animAttr, Loading core/res/res/anim/activity_close_enter.xml +29 −8 Original line number Diff line number Diff line Loading @@ -19,16 +19,37 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:fromXScale="1.1" android:toXScale="1" android:fromYScale="1.1" android:toYScale="1" android:pivotX="50%" android:pivotY="50%" <alpha android:fromAlpha="1.0" android:toAlpha="1.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="0" android:duration="450" /> <translate android:fromXDelta="-10%" android:toXDelta="0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:startOffset="0" android:duration="450" /> <extend android:fromExtendLeft="0" android:fromExtendTop="0" android:fromExtendRight="10%" android:fromExtendBottom="0" android:toExtendLeft="0" android:toExtendTop="0" android:toExtendRight="10%" android:toExtendBottom="0" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> android:startOffset="0" android:duration="450" /> </set> No newline at end of file core/res/res/anim/activity_close_enter_legacy.xml 0 → 100644 +34 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2009, The Android Open Source Project ** ** 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. */ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:fromXScale="1.1" android:toXScale="1" android:fromYScale="1.1" android:toYScale="1" android:pivotX="50%" android:pivotY="50%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> </set> No newline at end of file core/res/res/anim/activity_close_exit.xml +24 −13 Original line number Diff line number Diff line Loading @@ -18,27 +18,38 @@ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" android:zAdjustment="top"> android:shareInterpolator="false"> <alpha android:fromAlpha="1" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="33" android:duration="50"/> <scale android:fromXScale="1" android:toXScale="0.9" android:fromYScale="1" android:toYScale="0.9" android:pivotX="50%" android:pivotY="50%" android:startOffset="35" android:duration="83" /> <translate android:fromXDelta="0" android:toXDelta="10%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> android:startOffset="0" android:duration="450" /> <extend android:fromExtendLeft="10%" android:fromExtendTop="0" android:fromExtendRight="0" android:fromExtendBottom="0" android:toExtendLeft="10%" android:toExtendTop="0" android:toExtendRight="0" android:toExtendBottom="0" android:interpolator="@interpolator/fast_out_extra_slow_in" android:startOffset="0" android:duration="450" /> </set> core/res/res/anim/activity_close_exit_legacy.xml 0 → 100644 +44 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2009, The Android Open Source Project ** ** 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. */ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" android:zAdjustment="top"> <alpha android:fromAlpha="1" android:toAlpha="0.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="33" android:duration="50"/> <scale android:fromXScale="1" android:toXScale="0.9" android:fromYScale="1" android:toYScale="0.9" android:pivotX="50%" android:pivotY="50%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> </set> Loading
core/java/com/android/internal/policy/TransitionAnimation.java +25 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,10 @@ public class TransitionAnimation { private static final String DEFAULT_PACKAGE = "android"; // TODO (b/215515255): remove once we full migrate to shell transitions private static final boolean SHELL_TRANSITIONS_ENABLED = SystemProperties.getBoolean("persist.debug.shell_transit", false); private final Context mContext; private final String mTag; Loading Loading @@ -252,6 +256,9 @@ public class TransitionAnimation { resId = ent.array.getResourceId(animAttr, 0); } } if (!SHELL_TRANSITIONS_ENABLED) { resId = updateToLegacyIfNeeded(resId); } resId = updateToTranslucentAnimIfNeeded(resId, transit); if (ResourceId.isValid(resId)) { return loadAnimationSafely(context, resId, mTag); Loading @@ -259,6 +266,24 @@ public class TransitionAnimation { return null; } /** * Replace animations that are not compatible with the legacy transition system with ones that * are compatible with it. * TODO (b/215515255): remove once we full migrate to shell transitions */ private int updateToLegacyIfNeeded(int anim) { if (anim == R.anim.activity_open_enter) { return R.anim.activity_open_enter_legacy; } else if (anim == R.anim.activity_open_exit) { return R.anim.activity_open_exit_legacy; } else if (anim == R.anim.activity_close_enter) { return R.anim.activity_close_enter_legacy; } else if (anim == R.anim.activity_close_exit) { return R.anim.activity_close_exit_legacy; } return anim; } /** Load animation by attribute Id from a specific AnimationStyle resource. */ @Nullable public Animation loadAnimationAttr(String packageName, int animStyleResId, int animAttr, Loading
core/res/res/anim/activity_close_enter.xml +29 −8 Original line number Diff line number Diff line Loading @@ -19,16 +19,37 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:fromXScale="1.1" android:toXScale="1" android:fromYScale="1.1" android:toYScale="1" android:pivotX="50%" android:pivotY="50%" <alpha android:fromAlpha="1.0" android:toAlpha="1.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="0" android:duration="450" /> <translate android:fromXDelta="-10%" android:toXDelta="0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:startOffset="0" android:duration="450" /> <extend android:fromExtendLeft="0" android:fromExtendTop="0" android:fromExtendRight="10%" android:fromExtendBottom="0" android:toExtendLeft="0" android:toExtendTop="0" android:toExtendRight="10%" android:toExtendBottom="0" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> android:startOffset="0" android:duration="450" /> </set> No newline at end of file
core/res/res/anim/activity_close_enter_legacy.xml 0 → 100644 +34 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2009, The Android Open Source Project ** ** 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. */ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:fromXScale="1.1" android:toXScale="1" android:fromYScale="1.1" android:toYScale="1" android:pivotX="50%" android:pivotY="50%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> </set> No newline at end of file
core/res/res/anim/activity_close_exit.xml +24 −13 Original line number Diff line number Diff line Loading @@ -18,27 +18,38 @@ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" android:zAdjustment="top"> android:shareInterpolator="false"> <alpha android:fromAlpha="1" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="33" android:duration="50"/> <scale android:fromXScale="1" android:toXScale="0.9" android:fromYScale="1" android:toYScale="0.9" android:pivotX="50%" android:pivotY="50%" android:startOffset="35" android:duration="83" /> <translate android:fromXDelta="0" android:toXDelta="10%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> android:startOffset="0" android:duration="450" /> <extend android:fromExtendLeft="10%" android:fromExtendTop="0" android:fromExtendRight="0" android:fromExtendBottom="0" android:toExtendLeft="10%" android:toExtendTop="0" android:toExtendRight="0" android:toExtendBottom="0" android:interpolator="@interpolator/fast_out_extra_slow_in" android:startOffset="0" android:duration="450" /> </set>
core/res/res/anim/activity_close_exit_legacy.xml 0 → 100644 +44 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** Copyright 2009, The Android Open Source Project ** ** 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. */ --> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" android:zAdjustment="top"> <alpha android:fromAlpha="1" android:toAlpha="0.0" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/linear" android:startOffset="33" android:duration="50"/> <scale android:fromXScale="1" android:toXScale="0.9" android:fromYScale="1" android:toYScale="0.9" android:pivotX="50%" android:pivotY="50%" android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" android:interpolator="@interpolator/fast_out_extra_slow_in" android:duration="400"/> </set>