summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Mattson <jmatt@google.com>2014-08-15 21:03:06 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-15 21:03:06 +0000
commitd3077b95f8639fee553323bd4155862ad4db4596 (patch)
tree51761812eedf32db9ebef325c48a69795b26325f
parentf62621845c86f410705d78586701c252bd0e5eab (diff)
parente9695fec7ac1c9b2e71cc88900ff89e5af7259d2 (diff)
downloadframeworks_base-d3077b95f8639fee553323bd4155862ad4db4596.zip
frameworks_base-d3077b95f8639fee553323bd4155862ad4db4596.tar.gz
frameworks_base-d3077b95f8639fee553323bd4155862ad4db4596.tar.bz2
am f6c0767d: Merge "Add fragment animations to setup leanback theme" into lmp-dev
* commit 'f6c0767d46d5f42129a760c705ad0cb6e1e2fbe6': Add fragment animations to setup leanback theme
-rw-r--r--core/res/res/animator/leanback_setup_fragment_close_enter.xml27
-rw-r--r--core/res/res/animator/leanback_setup_fragment_close_exit.xml34
-rw-r--r--core/res/res/animator/leanback_setup_fragment_open_enter.xml34
-rw-r--r--core/res/res/animator/leanback_setup_fragment_open_exit.xml27
-rw-r--r--core/res/res/values/dimens_leanback.xml71
-rw-r--r--core/res/res/values/styles_leanback.xml6
-rw-r--r--core/res/res/values/themes_leanback.xml1
7 files changed, 198 insertions, 2 deletions
diff --git a/core/res/res/animator/leanback_setup_fragment_close_enter.xml b/core/res/res/animator/leanback_setup_fragment_close_enter.xml
new file mode 100644
index 0000000..1626dd3
--- /dev/null
+++ b/core/res/res/animator/leanback_setup_fragment_close_enter.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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">
+ <objectAnimator
+ android:propertyName="alpha"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_alpha_backward_in_content_start"
+ android:valueTo="@dimen/leanback_setup_alpha_backward_in_content_end"
+ android:duration="@integer/leanback_setup_alpha_backward_in_content_duration"
+ android:startOffset="@integer/leanback_setup_alpha_backward_in_content_delay"/>
+</set>
diff --git a/core/res/res/animator/leanback_setup_fragment_close_exit.xml b/core/res/res/animator/leanback_setup_fragment_close_exit.xml
new file mode 100644
index 0000000..a827df4
--- /dev/null
+++ b/core/res/res/animator/leanback_setup_fragment_close_exit.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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">
+ <objectAnimator
+ android:propertyName="alpha"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_alpha_backward_out_content_start"
+ android:valueTo="@dimen/leanback_setup_alpha_backward_out_content_end"
+ android:duration="@integer/leanback_setup_alpha_backward_out_content_duration"
+ android:startOffset="@integer/leanback_setup_alpha_backward_out_content_delay"/>
+ <objectAnimator
+ android:propertyName="x"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_translation_backward_out_content_start"
+ android:valueTo="@dimen/leanback_setup_translation_backward_out_content_end"
+ android:duration="@integer/leanback_setup_translation_backward_out_content_duration"
+ android:startOffset="@integer/leanback_setup_translation_backward_out_content_delay"/>
+</set>
diff --git a/core/res/res/animator/leanback_setup_fragment_open_enter.xml b/core/res/res/animator/leanback_setup_fragment_open_enter.xml
new file mode 100644
index 0000000..34b9a57
--- /dev/null
+++ b/core/res/res/animator/leanback_setup_fragment_open_enter.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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" >
+ <objectAnimator
+ android:propertyName="alpha"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_alpha_forward_in_content_start"
+ android:valueTo="@dimen/leanback_setup_alpha_forward_in_content_end"
+ android:duration="@integer/leanback_setup_alpha_forward_in_content_duration"
+ android:startOffset="@integer/leanback_setup_alpha_forward_in_content_delay"/>
+ <objectAnimator
+ android:propertyName="x"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_translation_forward_in_content_start"
+ android:valueTo="@dimen/leanback_setup_translation_forward_in_content_end"
+ android:duration="@integer/leanback_setup_translation_forward_in_content_duration"
+ android:startOffset="@integer/leanback_setup_translation_forward_in_content_delay" />
+</set>
diff --git a/core/res/res/animator/leanback_setup_fragment_open_exit.xml b/core/res/res/animator/leanback_setup_fragment_open_exit.xml
new file mode 100644
index 0000000..5622db4
--- /dev/null
+++ b/core/res/res/animator/leanback_setup_fragment_open_exit.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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">
+ <objectAnimator
+ android:propertyName="alpha"
+ android:valueType="floatType"
+ android:valueFrom="@dimen/leanback_setup_alpha_forward_out_content_start"
+ android:valueTo="@dimen/leanback_setup_alpha_forward_out_content_end"
+ android:duration="@integer/leanback_setup_alpha_forward_out_content_duration"
+ android:startOffset="@integer/leanback_setup_alpha_forward_out_content_delay"/>
+</set>
diff --git a/core/res/res/values/dimens_leanback.xml b/core/res/res/values/dimens_leanback.xml
index fb5f8f0..c824a2a 100644
--- a/core/res/res/values/dimens_leanback.xml
+++ b/core/res/res/values/dimens_leanback.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,7 +13,74 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources>
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Default alpha value for disabled elements. -->
<item name="disabled_alpha_leanback_formwizard" format="float" type="dimen">0.2</item>
+ <!-- The duration of most animations related to screen content transitions -->
+ <integer name="leanback_setup_base_animation_duration">500</integer>
+ <item name="leanback_setup_alpha_animiation_max_opacity" format="float" type="dimen">1.0</item>
+ <item name="leanback_setup_alpha_animiation_min_opacity" format="float" type="dimen">0.0</item>
+ <!-- Where stable, on-screen content rests -->
+ <dimen name="leanback_setup_translation_content_resting_point">0dp</dimen>
+ <integer name="leanback_setup_translation_content_resting_point_v4">0</integer>
+ <!-- The screen position at which content enters/exits. If you're over the edge of the cliff, we can't see you. -->
+ <dimen name="leanback_setup_translation_content_cliff">100dp</dimen>
+ <integer name="leanback_setup_translation_content_cliff_v4">200</integer>
+
+ <!-- Opacity animation for activity background -->
+ <!-- The opacity of the background of the new activity background when the alpha animation starts-->
+ <item name="leanback_setup_alpha_activity_in_bkg_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <!-- The opacity of the background of the new activity background when the alpha animation ends-->
+ <item name="leanback_setup_alpha_activity_in_bkg_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <integer name="leanback_setup_alpha_activity_in_bkg_delay">0</integer>
+ <integer name="leanback_setup_alpha_activity_in_bkg_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <item name="leanback_setup_alpha_activity_out_bkg_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <!-- The opacity of the background of the new activity background when the alpha animation ends-->
+ <item name="leanback_setup_alpha_activity_out_bkg_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <integer name="leanback_setup_alpha_activity_out_bkg_delay">0</integer>
+ <integer name="leanback_setup_alpha_activity_out_bkg_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <!-- Content forward animation configuration values -->
+ <!-- Parameter for alpha animation of new content coming on to the screen when we're moving "forward" -->
+ <!-- Initial opacity of the new content that is coming on to the screen -->
+ <item name="leanback_setup_alpha_forward_in_content_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <item name="leanback_setup_alpha_forward_in_content_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <integer name="leanback_setup_alpha_forward_in_content_delay">0</integer>
+ <integer name="leanback_setup_alpha_forward_in_content_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <item name="leanback_setup_alpha_forward_out_content_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <item name="leanback_setup_alpha_forward_out_content_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <integer name="leanback_setup_alpha_forward_out_content_delay">0</integer>
+ <integer name="leanback_setup_alpha_forward_out_content_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <!-- Position animation of incoming content during a "forward" transition -->
+ <dimen name="leanback_setup_translation_forward_in_content_start">@dimen/leanback_setup_translation_content_cliff</dimen>
+ <dimen name="leanback_setup_translation_forward_in_content_start_v4">@integer/leanback_setup_translation_content_cliff_v4</dimen>
+ <dimen name="leanback_setup_translation_forward_in_content_end">@dimen/leanback_setup_translation_content_resting_point</dimen>
+ <dimen name="leanback_setup_translation_forward_in_content_end_v4">@integer/leanback_setup_translation_content_resting_point_v4</dimen>
+ <integer name="leanback_setup_translation_forward_in_content_delay">0</integer>
+ <integer name="leanback_setup_translation_forward_in_content_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <!-- Content backward animation configuration values -->
+ <!-- Alpha animation values for the content that will be displayed after the transition is complete, this is the content coming in. -->
+ <item name="leanback_setup_alpha_backward_in_content_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <item name="leanback_setup_alpha_backward_in_content_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <integer name="leanback_setup_alpha_backward_in_content_delay">0</integer>
+ <integer name="leanback_setup_alpha_backward_in_content_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <!-- Alpha animiation values for the content that is displayed when the transition starts, this is the content going away. -->
+ <item name="leanback_setup_alpha_backward_out_content_start" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_max_opacity</item>
+ <item name="leanback_setup_alpha_backward_out_content_end" format="float" type="dimen">@dimen/leanback_setup_alpha_animiation_min_opacity</item>
+ <integer name="leanback_setup_alpha_backward_out_content_delay">0</integer>
+ <integer name="leanback_setup_alpha_backward_out_content_duration">@integer/leanback_setup_base_animation_duration</integer>
+
+ <!-- Position animation for content that is displayed when the transition starts, this is the content going away. -->
+ <dimen name="leanback_setup_translation_backward_out_content_start">@dimen/leanback_setup_translation_content_resting_point</dimen>
+ <dimen name="leanback_setup_translation_backward_out_content_start_v4">@integer/leanback_setup_translation_content_resting_point_v4</dimen>
+ <dimen name="leanback_setup_translation_backward_out_content_end">@dimen/leanback_setup_translation_content_cliff</dimen>
+ <dimen name="leanback_setup_translation_backward_out_content_end_v4">@integer/leanback_setup_translation_content_cliff_v4</dimen>
+ <integer name="leanback_setup_translation_backward_out_content_delay">0</integer>
+ <integer name="leanback_setup_translation_backward_out_content_duration">@integer/leanback_setup_base_animation_duration</integer>
</resources>
diff --git a/core/res/res/values/styles_leanback.xml b/core/res/res/values/styles_leanback.xml
index 72735f7..da83c36 100644
--- a/core/res/res/values/styles_leanback.xml
+++ b/core/res/res/values/styles_leanback.xml
@@ -65,4 +65,10 @@
<item name="fontFamily">sans-serif-condensed</item>
</style>
+ <style name="WindowAnimationStyle.Leanback.Setup" parent="@style/Animation.Material.Activity">
+ <item name="android:fragmentOpenEnterAnimation">@animator/leanback_setup_fragment_open_enter</item>
+ <item name="android:fragmentOpenExitAnimation">@animator/leanback_setup_fragment_open_exit</item>
+ <item name="android:fragmentCloseEnterAnimation">@animator/leanback_setup_fragment_close_enter</item>
+ <item name="android:fragmentCloseExitAnimation">@animator/leanback_setup_fragment_close_exit</item>
+ </style>
</resources>
diff --git a/core/res/res/values/themes_leanback.xml b/core/res/res/values/themes_leanback.xml
index 1cda843..0a2c0a4 100644
--- a/core/res/res/values/themes_leanback.xml
+++ b/core/res/res/values/themes_leanback.xml
@@ -58,5 +58,6 @@
<item name="textAppearanceListItem">@style/TextAppearance.Leanback.FormWizard.ListItem</item>
<item name="textAppearance">@style/TextAppearance.Leanback.FormWizard</item>
<item name="textColorPrimary">@color/primary_text_leanback_formwizard_dark</item>
+ <item name="windowAnimationStyle">@style/WindowAnimationStyle.Leanback.Setup</item>
</style>
</resources>