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

Commit 4f62f21a authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Change screen rotation animation

Screenshot no longer scales to fit
new layout dimensions.
Added color layer underneath to not
have "empty" black spots
Add separate custom fade in/out animation
durations and interpolators.

Fixes: 142332867, 143780390
Test: Tested rotation in from all 4
orientations to the other 3. Tested full
screen app rotation as that has separate
code flow. Currently only code flow using
custom animations is user switching, tested
that as well. (Note that animation doesn't
actually rotate the screen but only does
a fade animation.)
Change-Id: I8b23319160e688837cfca043a9fb66a98457c45b
parent 4acb012c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ message AnimationSpecProto {
    optional WindowAnimationSpecProto window = 1;
    optional MoveAnimationSpecProto move = 2;
    optional AlphaAnimationSpecProto alpha = 3;
    optional RotationAnimationSpecProto rotate = 4;
}

/* represents WindowAnimationSpec */
@@ -76,3 +77,12 @@ message AlphaAnimationSpecProto {
    optional float to = 2;
    optional int64 duration_ms = 3;
}

/* represents RotationAnimationSpec */
message RotationAnimationSpecProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    optional float start_luma = 1;
    optional float end_luma = 2;
    optional int64 duration_ms = 3;
}
+20 −20
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2010, 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.
*/
  ~ Copyright (C) 2019 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">
    <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
            android:interpolator="@interpolator/decelerate_quint"
            android:duration="@android:integer/config_shortAnimTime" />
    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
        android:interpolator="@interpolator/screen_rotation_alpha_in"
        android:fillEnabled="true"
        android:fillBefore="true" android:fillAfter="true"
        android:duration="@android:integer/config_screen_rotation_fade_in" />
</set>
+20 −17
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2010, 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.
*/
  ~ Copyright (C) 2019 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">
    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
        android:interpolator="@interpolator/screen_rotation_alpha_out"
        android:fillEnabled="true"
        android:fillBefore="true" android:fillAfter="true"
        android:duration="@android:integer/config_screen_rotation_fade_out" />
</set>
+0 −25
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2012, 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">
    <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
            android:interpolator="@interpolator/decelerate_quint"
            android:duration="@android:integer/config_shortAnimTime" />
</set>
+6 −6
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@
    android:shareInterpolator="false">
    <rotate android:fromDegrees="180" android:toDegrees="0"
        android:pivotX="50%" android:pivotY="50%"
            android:interpolator="@interpolator/decelerate_quint"
        android:fillEnabled="true"
        android:fillBefore="true" android:fillAfter="true"
            android:duration="@android:integer/config_mediumAnimTime" />
        android:interpolator="@interpolator/fast_out_slow_in"
        android:duration="@android:integer/config_screen_rotation_total_180" />
</set>
Loading