Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f159f179 authored by Sakar Khattar's avatar Sakar Khattar Committed by Todd Lee
Browse files

Implement window enter/exit animations as system level XML animations.

Note this generalizes from previous 'circle' presumptions and generalizes to 'rounded' windows. Implementation is largely unchanged as actual radius will be determined by R.dimen.rounded_corner_radius

Note that this implementation only covers the app open/close and does
NOT include support for special accommodation during app swipe to dismiss (i.e. clipping outline etc).

Bug: 277992557

Test: Tested locally on device
Change-Id: Ib182fa24941b92c3d7cdef6f9337eb175fc2e680
(cherry picked from commit eaa39bd4d77358bd033017797d2376eed5c9dcfe)
parent 3ed7fb93
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2021, 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:zAdjustment="normal" android:hasRoundedCorners="true" android:shareInterpolator="false"
     android:detachWallpaper="true">
    <scale android:fromXScale="0.75" android:toXScale="1.0"
           android:fromYScale="0.75" android:toYScale="1.0"
           android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
           android:pivotX="50%p" android:pivotY="50%p"
           android:interpolator="@interpolator/rounded_window_interpolator"
           android:duration="250"/>
    <alpha android:fromAlpha="0.25" android:toAlpha="1.0"
           android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
           android:duration="150"
           android:interpolator="@android:interpolator/rounded_window_interpolator"/>
</set>
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2021, 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:zAdjustment="normal" android:hasRoundedCorners="true" android:shareInterpolator="false"
     android:detachWallpaper="true">
    <scale android:fromXScale="1.0" android:toXScale="0.75"
           android:fromYScale="1.0" android:toYScale="0.75"
           android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
           android:pivotX="50%p" android:pivotY="50%p"
           android:interpolator="@interpolator/rounded_window_interpolator"
           android:duration="250"/>
    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
           android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
           android:duration="250"
           android:interpolator="@android:interpolator/rounded_window_interpolator"/>
</set>
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2021, 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.
*/
-->

<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:controlX1="0.4"
                  android:controlY1="0"
                  android:controlX2="0.2"
                  android:controlY2="1" />
+16 −16
Original line number Diff line number Diff line
@@ -30,27 +30,27 @@ please see styles_device_defaults.xml.
 -->
<resources>
    <style name="Animation.Material.Activity" parent="Animation.Activity">
        <item name="activityOpenEnterAnimation">@anim/slide_in_enter_micro</item>
        <item name="activityOpenRemoteViewsEnterAnimation">@anim/slide_in_enter_micro</item>
        <item name="activityOpenExitAnimation">@anim/slide_in_exit_micro</item>
        <item name="activityOpenEnterAnimation">@anim/rounded_window_enter</item>
        <item name="activityOpenRemoteViewsEnterAnimation">@anim/rounded_window_enter</item>
        <item name="activityOpenExitAnimation">@null</item>
        <item name="activityCloseEnterAnimation">@null</item>
        <item name="activityCloseExitAnimation">@anim/slide_out_micro</item>
        <item name="taskOpenEnterAnimation">@anim/slide_in_enter_micro</item>
        <item name="taskOpenExitAnimation">@anim/slide_in_exit_micro</item>
        <item name="activityCloseExitAnimation">@anim/rounded_window_exit</item>
        <item name="taskOpenEnterAnimation">@anim/rounded_window_enter</item>
        <item name="taskOpenExitAnimation">@null</item>
        <item name="taskCloseEnterAnimation">@null</item>
        <item name="taskCloseExitAnimation">@anim/slide_out_micro</item>
        <item name="taskToFrontEnterAnimation">@null</item>
        <item name="taskToFrontExitAnimation">@anim/slide_out_micro</item>
        <item name="taskCloseExitAnimation">@anim/rounded_window_exit</item>
        <item name="taskToFrontEnterAnimation">@anim/rounded_window_enter</item>
        <item name="taskToFrontExitAnimation">@null</item>
        <item name="taskToBackEnterAnimation">@null</item>
        <item name="taskToBackExitAnimation">@anim/slide_out_micro</item>
        <item name="taskToBackExitAnimation">@anim/rounded_window_exit</item>
        <item name="wallpaperOpenEnterAnimation">@null</item>
        <item name="wallpaperOpenExitAnimation">@anim/slide_out_micro</item>
        <item name="wallpaperCloseEnterAnimation">@anim/slide_in_enter_micro</item>
        <item name="wallpaperCloseExitAnimation">@anim/slide_in_exit_micro</item>
        <item name="wallpaperOpenExitAnimation">@anim/rounded_window_exit</item>
        <item name="wallpaperCloseEnterAnimation">@anim/rounded_window_enter</item>
        <item name="wallpaperCloseExitAnimation">@null</item>
        <item name="wallpaperIntraOpenEnterAnimation">@null</item>
        <item name="wallpaperIntraOpenExitAnimation">@anim/slide_out_micro</item>
        <item name="wallpaperIntraCloseEnterAnimation">@anim/slide_in_enter_micro</item>
        <item name="wallpaperIntraCloseExitAnimation">@anim/slide_in_exit_micro</item>
        <item name="wallpaperIntraOpenExitAnimation">@anim/rounded_window_exit</item>
        <item name="wallpaperIntraCloseEnterAnimation">@anim/rounded_window_enter</item>
        <item name="wallpaperIntraCloseExitAnimation">@null</item>
    </style>

    <style name="PreferenceFragment.Material" parent="BasePreferenceFragment">