Skip to content

Commit 9fd7480

Browse files
author
Dianne Hackborn
committed
More work on rotation animation.
The black frame is now a separate animation element. This allows us to have it move through the aspect ratio change, without the old and new screen elements doing weird aspect ratio scalings. This makes the animation generally look different (more like a reveal), not sure if it is better or worse, but definitely has less artifacts in things like the gallery. Also tweaked the animation definitions a bit. Change-Id: I94c274ba04bbc7a675946dc6c1778e19386e4a66
1 parent f8acebe commit 9fd7480

14 files changed

+375
-47
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<alpha android:fromAlpha="1.0" android:toAlpha="1.0"
23+
android:interpolator="@interpolator/decelerate_quint"
24+
android:duration="@android:integer/config_shortAnimTime" />
25+
</set>

core/res/res/anim/screen_rotate_180_enter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
android:fillEnabled="true"
2626
android:fillBefore="true" android:fillAfter="true"
2727
android:duration="@android:integer/config_mediumAnimTime" />
28-
</set>
28+
</set>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<rotate android:fromDegrees="180" android:toDegrees="0"
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" />
28+
</set>

core/res/res/anim/screen_rotate_finish_enter.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@
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.25"
23-
android:fromYScale="1.0" android:toYScale="1.25"
22+
<scale android:fromXScale="1.0" android:toXScale="1.1111111111111"
23+
android:fromYScale="1.0" android:toYScale="1.1111111111111"
2424
android:pivotX="50%" android:pivotY="50%"
25-
android:interpolator="@interpolator/decelerate_quint"
25+
android:interpolator="@interpolator/accelerate_decelerate"
2626
android:fillEnabled="true"
2727
android:fillBefore="true" android:fillAfter="true"
28-
android:duration="@android:integer/config_mediumAnimTime"/>
28+
android:duration="@android:integer/config_shortAnimTime"/>
29+
<!--
2930
<scale android:fromXScale="100%p" android:toXScale="100%"
3031
android:fromYScale="100%p" android:toYScale="100%"
3132
android:pivotX="50%" android:pivotY="50%"
3233
android:interpolator="@interpolator/decelerate_quint"
3334
android:fillEnabled="true"
3435
android:fillBefore="true" android:fillAfter="true"
3536
android:duration="@android:integer/config_mediumAnimTime" />
37+
-->
3638
</set>

core/res/res/anim/screen_rotate_finish_exit.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,21 @@
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.25"
23-
android:fromYScale="1.0" android:toYScale="1.25"
22+
<scale android:fromXScale="1.0" android:toXScale="1.0"
23+
android:fromYScale="1.0" android:toYScale="1.0"
2424
android:pivotX="50%" android:pivotY="50%"
25-
android:interpolator="@interpolator/decelerate_quint"
25+
android:interpolator="@interpolator/accelerate_decelerate"
2626
android:fillEnabled="true"
2727
android:fillBefore="false" android:fillAfter="true"
28-
android:duration="@android:integer/config_mediumAnimTime"/>
29-
<!--
28+
android:duration="@android:integer/config_shortAnimTime"/>
3029
<scale android:fromXScale="100%" android:toXScale="100%p"
3130
android:fromYScale="100%" android:toYScale="100%p"
3231
android:pivotX="50%" android:pivotY="50%"
33-
android:interpolator="@interpolator/decelerate_quint"
32+
android:interpolator="@interpolator/accelerate_decelerate"
3433
android:duration="@android:integer/config_mediumAnimTime" />
35-
-->
3634
<alpha android:fromAlpha="1.0" android:toAlpha="0"
37-
android:interpolator="@interpolator/decelerate_quint"
35+
android:interpolator="@interpolator/accelerate_decelerate"
3836
android:fillEnabled="true"
3937
android:fillBefore="true" android:fillAfter="true"
40-
android:duration="@android:integer/config_mediumAnimTime" />
38+
android:duration="@android:integer/config_shortAnimTime" />
4139
</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.1111111111111"
23+
android:fromYScale="1.0" android:toYScale="1.1111111111111"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/accelerate_decelerate"
26+
android:fillEnabled="true"
27+
android:fillBefore="true" android:fillAfter="true"
28+
android:duration="@android:integer/config_shortAnimTime"/>
29+
<scale android:fromXScale="100%" android:toXScale="100%p"
30+
android:fromYScale="100%" android:toYScale="100%p"
31+
android:pivotX="50%" android:pivotY="50%"
32+
android:fillEnabled="true"
33+
android:fillBefore="true" android:fillAfter="true"
34+
android:interpolator="@interpolator/accelerate_decelerate"
35+
android:duration="@android:integer/config_shortAnimTime" />
36+
</set>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<rotate android:fromDegrees="0" android:toDegrees="90"
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" />
28+
</set>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<rotate android:fromDegrees="0" android:toDegrees="-90"
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" />
28+
</set>

core/res/res/anim/screen_rotate_start_enter.xml

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

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22-
<scale android:fromXScale="1.0" android:toXScale="0.8"
23-
android:fromYScale="1.0" android:toYScale="0.8"
22+
<scale android:fromXScale="1.0" android:toXScale="0.9"
23+
android:fromYScale="1.0" android:toYScale="0.9"
2424
android:pivotX="50%" android:pivotY="50%"
2525
android:interpolator="@interpolator/decelerate_quint"
2626
android:fillEnabled="true"

core/res/res/anim/screen_rotate_start_exit.xml

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

2020
<set xmlns:android="http://schemas.android.com/apk/res/android"
2121
android:shareInterpolator="false">
22-
<scale android:fromXScale="1.0" android:toXScale="0.8"
23-
android:fromYScale="1.0" android:toYScale="0.8"
22+
<scale android:fromXScale="1.0" android:toXScale="0.9"
23+
android:fromYScale="1.0" android:toYScale="0.9"
2424
android:pivotX="50%" android:pivotY="50%"
2525
android:interpolator="@interpolator/decelerate_quint"
2626
android:fillEnabled="true"

0 commit comments

Comments
 (0)