Skip to content

Commit fd1c5ed

Browse files
author
Dianne Hackborn
committed
New screen rotation animation design.
We now have an animation that can start as soon as we detect to rotate the screen, and have a different phase once the new UI is ready to complete the transition into it. Change-Id: I05b9c12a699232acbddc36b4a994a4452db71476
1 parent a6b8fe1 commit fd1c5ed

12 files changed

+674
-146
lines changed

core/res/res/anim/screen_rotate_180_enter.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,10 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22-
<scale android:fromXScale="1.0" android:toXScale="1.0"
23-
android:fromYScale=".9" android:toYScale="1.0"
24-
android:pivotX="50%p" android:pivotY="50%p"
25-
android:fillEnabled="true" android:fillBefore="true"
22+
<rotate android:fromDegrees="180" android:toDegrees="0"
23+
android:pivotX="50%" android:pivotY="50%"
2624
android:interpolator="@interpolator/decelerate_quint"
27-
android:startOffset="160"
28-
android:duration="300" />
29-
<alpha android:fromAlpha="0" android:toAlpha="1.0"
30-
android:fillEnabled="true" android:fillBefore="true"
31-
android:interpolator="@interpolator/decelerate_quint"
32-
android:startOffset="160"
33-
android:duration="300"/>
25+
android:fillEnabled="true"
26+
android:fillBefore="true" android:fillAfter="true"
27+
android:duration="@android:integer/config_mediumAnimTime" />
3428
</set>

core/res/res/anim/screen_rotate_180_exit.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22-
<scale android:fromXScale="1.0" android:toXScale="1.0"
23-
android:fromYScale="1.0" android:toYScale="0.0"
24-
android:pivotX="50%p" android:pivotY="50%p"
25-
android:interpolator="@interpolator/accelerate_cubic"
26-
android:duration="160" />
27-
<alpha android:fromAlpha="1.0" android:toAlpha="0"
28-
android:interpolator="@interpolator/decelerate_cubic"
29-
android:duration="160"/>
22+
<rotate android:fromDegrees="0" android:toDegrees="-180"
23+
android:pivotX="50%" android:pivotY="50%"
24+
android:interpolator="@interpolator/decelerate_quint"
25+
android:fillEnabled="true"
26+
android:fillBefore="true" android:fillAfter="true"
27+
android:duration="@android:integer/config_mediumAnimTime" />
3028
</set>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false">
22+
<scale android:fromXScale="1.0" android:toXScale="1.25"
23+
android:fromYScale="1.0" android:toYScale="1.25"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/decelerate_quint"
26+
android:fillEnabled="true"
27+
android:fillBefore="true" android:fillAfter="true"
28+
android:duration="@android:integer/config_mediumAnimTime"/>
29+
<scale android:fromXScale="100%p" android:toXScale="100%"
30+
android:fromYScale="100%p" android:toYScale="100%"
31+
android:pivotX="50%" android:pivotY="50%"
32+
android:interpolator="@interpolator/decelerate_quint"
33+
android:fillEnabled="true"
34+
android:fillBefore="true" android:fillAfter="true"
35+
android:duration="@android:integer/config_mediumAnimTime" />
36+
</set>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false">
22+
<scale android:fromXScale="1.0" android:toXScale="1.25"
23+
android:fromYScale="1.0" android:toYScale="1.25"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/decelerate_quint"
26+
android:fillEnabled="true"
27+
android:fillBefore="false" android:fillAfter="true"
28+
android:duration="@android:integer/config_mediumAnimTime"/>
29+
<!--
30+
<scale android:fromXScale="100%" android:toXScale="100%p"
31+
android:fromYScale="100%" android:toYScale="100%p"
32+
android:pivotX="50%" android:pivotY="50%"
33+
android:interpolator="@interpolator/decelerate_quint"
34+
android:duration="@android:integer/config_mediumAnimTime" />
35+
-->
36+
<alpha android:fromAlpha="1.0" android:toAlpha="0"
37+
android:interpolator="@interpolator/decelerate_quint"
38+
android:fillEnabled="true"
39+
android:fillBefore="true" android:fillAfter="true"
40+
android:duration="@android:integer/config_mediumAnimTime" />
41+
</set>

core/res/res/anim/screen_rotate_minus_90_enter.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,44 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22+
<!--
23+
<scale android:fromXScale="1.0" android:toXScale="0.565"
24+
android:fromYScale="1.0" android:toYScale="0.565"
25+
android:pivotX="50%" android:pivotY="50%"
26+
android:interpolator="@interpolator/decelerate_quint"
27+
android:fillEnabled="true"
28+
android:fillBefore="false" android:fillAfter="true"
29+
android:duration="@android:integer/config_mediumAnimTime"/>
30+
<scale android:fromXScale="1.0" android:toXScale="1.777777777"
31+
android:fromYScale="1.0" android:toYScale="1.777777777"
32+
android:pivotX="50%" android:pivotY="50%"
33+
android:interpolator="@interpolator/decelerate_quint"
34+
android:fillEnabled="true"
35+
android:fillBefore="false" android:fillAfter="true"
36+
android:startOffset="@android:integer/config_longAnimTime"
37+
android:duration="@android:integer/config_mediumAnimTime"/>
38+
<scale android:fromXScale="100%p" android:toXScale="100%"
39+
android:fromYScale="100%p" android:toYScale="100%"
40+
android:pivotX="50%" android:pivotY="50%"
41+
android:interpolator="@interpolator/decelerate_quint"
42+
android:fillEnabled="true"
43+
android:fillBefore="true" android:fillAfter="true"
44+
android:startOffset="@android:integer/config_longAnimTime"
45+
android:duration="@android:integer/config_mediumAnimTime" />
46+
-->
47+
<!--
48+
<scale android:fromXScale="100%p" android:toXScale="100%"
49+
android:fromYScale="100%p" android:toYScale="100%"
50+
android:pivotX="50%" android:pivotY="50%"
51+
android:interpolator="@interpolator/decelerate_quint"
52+
android:fillEnabled="true"
53+
android:fillBefore="true" android:fillAfter="true"
54+
android:duration="@android:integer/config_mediumAnimTime" />
55+
-->
2256
<rotate android:fromDegrees="-90" android:toDegrees="0"
2357
android:pivotX="50%" android:pivotY="50%"
2458
android:interpolator="@interpolator/decelerate_quint"
59+
android:fillEnabled="true"
60+
android:fillBefore="true" android:fillAfter="true"
2561
android:duration="@android:integer/config_mediumAnimTime" />
2662
</set>

core/res/res/anim/screen_rotate_minus_90_exit.xml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,51 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22+
<!--
23+
<scale android:fromXScale="1.0" android:toXScale="0.565"
24+
android:fromYScale="1.0" android:toYScale="0.565"
25+
android:pivotX="50%" android:pivotY="50%"
26+
android:interpolator="@interpolator/decelerate_quint"
27+
android:fillEnabled="true"
28+
android:fillBefore="false" android:fillAfter="true"
29+
android:duration="@android:integer/config_mediumAnimTime"/>
30+
<scale android:fromXScale="1.0" android:toXScale="1.777777777"
31+
android:fromYScale="1.0" android:toYScale="1.777777777"
32+
android:pivotX="50%" android:pivotY="50%"
33+
android:interpolator="@interpolator/decelerate_quint"
34+
android:fillEnabled="true"
35+
android:fillBefore="false" android:fillAfter="true"
36+
android:startOffset="@android:integer/config_longAnimTime"
37+
android:duration="@android:integer/config_mediumAnimTime"/>
2238
<scale android:fromXScale="100%" android:toXScale="100%p"
2339
android:fromYScale="100%" android:toYScale="100%p"
2440
android:pivotX="50%" android:pivotY="50%"
2541
android:interpolator="@interpolator/decelerate_quint"
42+
android:startOffset="@android:integer/config_longAnimTime"
2643
android:duration="@android:integer/config_mediumAnimTime" />
27-
<rotate android:fromDegrees="0" android:toDegrees="90"
44+
<alpha android:fromAlpha="1.0" android:toAlpha="0"
45+
android:interpolator="@interpolator/decelerate_quint"
46+
android:fillEnabled="true"
47+
android:fillBefore="false" android:fillAfter="true"
48+
android:startOffset="@android:integer/config_longAnimTime"
49+
android:duration="@android:integer/config_mediumAnimTime" />
50+
-->
51+
<!--
52+
<scale android:fromXScale="100%" android:toXScale="100%p"
53+
android:fromYScale="100%" android:toYScale="100%p"
2854
android:pivotX="50%" android:pivotY="50%"
2955
android:interpolator="@interpolator/decelerate_quint"
3056
android:duration="@android:integer/config_mediumAnimTime" />
3157
<alpha android:fromAlpha="1.0" android:toAlpha="0"
3258
android:interpolator="@interpolator/decelerate_quint"
59+
android:fillEnabled="true"
60+
android:fillBefore="false" android:fillAfter="true"
61+
android:duration="@android:integer/config_mediumAnimTime" />
62+
-->
63+
<rotate android:fromDegrees="0" android:toDegrees="90"
64+
android:pivotX="50%" android:pivotY="50%"
65+
android:interpolator="@interpolator/decelerate_quint"
66+
android:fillEnabled="true"
67+
android:fillBefore="true" android:fillAfter="true"
3368
android:duration="@android:integer/config_mediumAnimTime" />
3469
</set>

core/res/res/anim/screen_rotate_plus_90_enter.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,44 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22+
<!--
23+
<scale android:fromXScale="1.0" android:toXScale="0.565"
24+
android:fromYScale="1.0" android:toYScale="0.565"
25+
android:pivotX="50%" android:pivotY="50%"
26+
android:interpolator="@interpolator/decelerate_quint"
27+
android:fillEnabled="true"
28+
android:fillBefore="false" android:fillAfter="true"
29+
android:duration="@android:integer/config_mediumAnimTime"/>
30+
<scale android:fromXScale="1.0" android:toXScale="1.777777777"
31+
android:fromYScale="1.0" android:toYScale="1.777777777"
32+
android:pivotX="50%" android:pivotY="50%"
33+
android:interpolator="@interpolator/decelerate_quint"
34+
android:fillEnabled="true"
35+
android:fillBefore="false" android:fillAfter="true"
36+
android:startOffset="75"
37+
android:duration="@android:integer/config_mediumAnimTime"/>
38+
<scale android:fromXScale="100%p" android:toXScale="100%"
39+
android:fromYScale="100%p" android:toYScale="100%"
40+
android:pivotX="50%" android:pivotY="50%"
41+
android:interpolator="@interpolator/decelerate_quint"
42+
android:fillEnabled="true"
43+
android:fillBefore="true" android:fillAfter="true"
44+
android:startOffset="75"
45+
android:duration="@android:integer/config_mediumAnimTime" />
46+
-->
47+
<!--
48+
<scale android:fromXScale="100%p" android:toXScale="100%"
49+
android:fromYScale="100%p" android:toYScale="100%"
50+
android:pivotX="50%" android:pivotY="50%"
51+
android:interpolator="@interpolator/decelerate_quint"
52+
android:fillEnabled="true"
53+
android:fillBefore="true" android:fillAfter="true"
54+
android:duration="@android:integer/config_mediumAnimTime" />
55+
-->
2256
<rotate android:fromDegrees="90" android:toDegrees="0"
2357
android:pivotX="50%" android:pivotY="50%"
2458
android:interpolator="@interpolator/decelerate_quint"
59+
android:fillEnabled="true"
60+
android:fillBefore="true" android:fillAfter="true"
2561
android:duration="@android:integer/config_mediumAnimTime" />
2662
</set>

core/res/res/anim/screen_rotate_plus_90_exit.xml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,51 @@
1919

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22+
<!--
23+
<scale android:fromXScale="1.0" android:toXScale="0.565"
24+
android:fromYScale="1.0" android:toYScale="0.565"
25+
android:pivotX="50%" android:pivotY="50%"
26+
android:interpolator="@interpolator/decelerate_quint"
27+
android:fillEnabled="true"
28+
android:fillBefore="false" android:fillAfter="true"
29+
android:duration="@android:integer/config_mediumAnimTime"/>
30+
<scale android:fromXScale="1.0" android:toXScale="1.777777777"
31+
android:fromYScale="1.0" android:toYScale="1.777777777"
32+
android:pivotX="50%" android:pivotY="50%"
33+
android:interpolator="@interpolator/decelerate_quint"
34+
android:fillEnabled="true"
35+
android:fillBefore="false" android:fillAfter="true"
36+
android:startOffset="75"
37+
android:duration="@android:integer/config_mediumAnimTime"/>
2238
<scale android:fromXScale="100%" android:toXScale="100%p"
2339
android:fromYScale="100%" android:toYScale="100%p"
2440
android:pivotX="50%" android:pivotY="50%"
2541
android:interpolator="@interpolator/decelerate_quint"
42+
android:startOffset="75"
2643
android:duration="@android:integer/config_mediumAnimTime" />
27-
<rotate android:fromDegrees="0" android:toDegrees="-90"
44+
<alpha android:fromAlpha="1.0" android:toAlpha="0"
45+
android:interpolator="@interpolator/decelerate_quint"
46+
android:fillEnabled="true"
47+
android:fillBefore="false" android:fillAfter="true"
48+
android:startOffset="75"
49+
android:duration="@android:integer/config_mediumAnimTime" />
50+
-->
51+
<!--
52+
<scale android:fromXScale="100%" android:toXScale="100%p"
53+
android:fromYScale="100%" android:toYScale="100%p"
2854
android:pivotX="50%" android:pivotY="50%"
2955
android:interpolator="@interpolator/decelerate_quint"
3056
android:duration="@android:integer/config_mediumAnimTime" />
3157
<alpha android:fromAlpha="1.0" android:toAlpha="0"
3258
android:interpolator="@interpolator/decelerate_quint"
59+
android:fillEnabled="true"
60+
android:fillBefore="false" android:fillAfter="true"
61+
android:duration="@android:integer/config_mediumAnimTime" />
62+
-->
63+
<rotate android:fromDegrees="0" android:toDegrees="-90"
64+
android:pivotX="50%" android:pivotY="50%"
65+
android:interpolator="@interpolator/decelerate_quint"
66+
android:fillEnabled="true"
67+
android:fillBefore="true" android:fillAfter="true"
3368
android:duration="@android:integer/config_mediumAnimTime" />
3469
</set>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false">
22+
<scale android:fromXScale="1.0" android:toXScale="0.8"
23+
android:fromYScale="1.0" android:toYScale="0.8"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/decelerate_quint"
26+
android:fillEnabled="true"
27+
android:fillBefore="true" android:fillAfter="true"
28+
android:duration="@android:integer/config_mediumAnimTime"/>
29+
</set>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false">
22+
<scale android:fromXScale="1.0" android:toXScale="0.8"
23+
android:fromYScale="1.0" android:toYScale="0.8"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/decelerate_quint"
26+
android:fillEnabled="true"
27+
android:fillBefore="true" android:fillAfter="true"
28+
android:duration="@android:integer/config_mediumAnimTime"/>
29+
</set>

0 commit comments

Comments
 (0)