Revert "Revert "GuidedStepFragment transition and new features""
This reverts commit d7b834d0339476a8867c6d14e67ed9a08d314e75.
diff --git a/v17/leanback/api/current.txt b/v17/leanback/api/current.txt
index 840be78..52239c8 100644
--- a/v17/leanback/api/current.txt
+++ b/v17/leanback/api/current.txt
@@ -177,13 +177,16 @@
public class GuidedStepFragment extends android.app.Fragment {
ctor public GuidedStepFragment();
method public static int add(android.app.FragmentManager, android.support.v17.leanback.app.GuidedStepFragment);
+ method public static int add(android.app.FragmentManager, android.support.v17.leanback.app.GuidedStepFragment, int);
+ method public static int addAsRoot(android.app.Activity, android.support.v17.leanback.app.GuidedStepFragment, int);
method public android.view.View getActionItemView(int);
method public java.util.List<android.support.v17.leanback.widget.GuidedAction> getActions();
+ method protected int getContainerIdForBackground();
method public static android.support.v17.leanback.app.GuidedStepFragment getCurrentGuidedStepFragment(android.app.FragmentManager);
method public android.support.v17.leanback.widget.GuidanceStylist getGuidanceStylist();
method public android.support.v17.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
method public int getSelectedActionPosition();
- method protected boolean isEntryTransitionEnabled();
+ method public int getUiStyle();
method public void onCreateActions(java.util.List<android.support.v17.leanback.widget.GuidedAction>, android.os.Bundle);
method public android.support.v17.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
method public android.support.v17.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
@@ -191,10 +194,21 @@
method public void onGuidedActionClicked(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionEdited(android.support.v17.leanback.widget.GuidedAction);
method public void onGuidedActionFocused(android.support.v17.leanback.widget.GuidedAction);
+ method protected android.app.Fragment onProvideBackgroundFragment();
+ method protected void onProvideFragmentTransitions();
method public int onProvideTheme();
method public void setActions(java.util.List<android.support.v17.leanback.widget.GuidedAction>);
- method protected void setEntryTransitionEnabled(boolean);
method public void setSelectedActionPosition(int);
+ method public void setUiStyle(int);
+ field public static final java.lang.String EXTRA_UI_STYLE = "uiStyle";
+ field public static final int UI_STYLE_ACTIVITY_ROOT = 2; // 0x2
+ field public static final int UI_STYLE_DEFAULT = 0; // 0x0
+ field public static final int UI_STYLE_ENTRANCE = 1; // 0x1
+ }
+
+ public static class GuidedStepFragment.GuidedStepBackgroundFragment extends android.app.Fragment {
+ ctor public GuidedStepFragment.GuidedStepBackgroundFragment();
+ method protected void onProvideFragmentTransitions();
}
public class HeadersFragment extends android.support.v17.leanback.app.BaseRowFragment {
@@ -725,12 +739,6 @@
}
public abstract interface FragmentAnimationProvider {
- method public abstract void onActivityEnter(java.util.List<android.animation.Animator>);
- method public abstract void onActivityExit(java.util.List<android.animation.Animator>);
- method public abstract void onFragmentEnter(java.util.List<android.animation.Animator>);
- method public abstract void onFragmentExit(java.util.List<android.animation.Animator>);
- method public abstract void onFragmentReenter(java.util.List<android.animation.Animator>);
- method public abstract void onFragmentReturn(java.util.List<android.animation.Animator>);
method public abstract void onImeAppearing(java.util.List<android.animation.Animator>);
method public abstract void onImeDisappearing(java.util.List<android.animation.Animator>);
}
@@ -803,13 +811,7 @@
method public android.widget.TextView getDescriptionView();
method public android.widget.ImageView getIconView();
method public android.widget.TextView getTitleView();
- method public void onActivityEnter(java.util.List<android.animation.Animator>);
- method public void onActivityExit(java.util.List<android.animation.Animator>);
method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.support.v17.leanback.widget.GuidanceStylist.Guidance);
- method public void onFragmentEnter(java.util.List<android.animation.Animator>);
- method public void onFragmentExit(java.util.List<android.animation.Animator>);
- method public void onFragmentReenter(java.util.List<android.animation.Animator>);
- method public void onFragmentReturn(java.util.List<android.animation.Animator>);
method public void onImeAppearing(java.util.List<android.animation.Animator>);
method public void onImeDisappearing(java.util.List<android.animation.Animator>);
method public int onProvideLayoutId();
@@ -870,18 +872,12 @@
public class GuidedActionsStylist implements android.support.v17.leanback.widget.FragmentAnimationProvider {
ctor public GuidedActionsStylist();
method public android.support.v17.leanback.widget.VerticalGridView getActionsGridView();
- method public void onActivityEnter(java.util.List<android.animation.Animator>);
- method public void onActivityExit(java.util.List<android.animation.Animator>);
method public void onAnimateItemChecked(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
method public void onAnimateItemFocused(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
method public void onAnimateItemPressed(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
method public void onBindViewHolder(android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder, android.support.v17.leanback.widget.GuidedAction);
method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup);
method public android.support.v17.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup);
- method public void onFragmentEnter(java.util.List<android.animation.Animator>);
- method public void onFragmentExit(java.util.List<android.animation.Animator>);
- method public void onFragmentReenter(java.util.List<android.animation.Animator>);
- method public void onFragmentReturn(java.util.List<android.animation.Animator>);
method public void onImeAppearing(java.util.List<android.animation.Animator>);
method public void onImeDisappearing(java.util.List<android.animation.Animator>);
method public int onProvideItemLayoutId();
diff --git a/v17/leanback/api21/android/support/v17/leanback/transition/TransitionHelperApi21.java b/v17/leanback/api21/android/support/v17/leanback/transition/TransitionHelperApi21.java
index 00ebf4c..a3b1bfc 100644
--- a/v17/leanback/api21/android/support/v17/leanback/transition/TransitionHelperApi21.java
+++ b/v17/leanback/api21/android/support/v17/leanback/transition/TransitionHelperApi21.java
@@ -14,8 +14,10 @@
package android.support.v17.leanback.transition;
import android.R;
+import android.app.Fragment;
import android.content.Context;
import android.transition.ChangeTransform;
+import android.transition.Transition;
import android.view.Window;
import android.view.animation.AnimationUtils;
@@ -24,6 +26,14 @@
TransitionHelperApi21() {
}
+ public static void setEnterTransition(android.app.Fragment fragment, Object transition) {
+ fragment.setEnterTransition((Transition)transition);
+ }
+
+ public static void setExitTransition(android.app.Fragment fragment, Object transition) {
+ fragment.setExitTransition((Transition)transition);
+ }
+
public static Object getSharedElementEnterTransition(Window window) {
return window.getSharedElementEnterTransition();
}
@@ -63,4 +73,8 @@
public static Object createDefaultInterpolator(Context context) {
return AnimationUtils.loadInterpolator(context, R.interpolator.fast_out_linear_in);
}
+
+ public static Object createFadeAndShortSlide(int edge) {
+ return new FadeAndShortSlide(edge);
+ }
}
diff --git a/v17/leanback/res/animator/lb_guidance_entry.xml b/v17/leanback/res/animator/lb_guidance_entry.xml
deleted file mode 100644
index e10d2ef..0000000
--- a/v17/leanback/res/animator/lb_guidance_entry.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="sequentially">
-
- <set android:ordering="together">
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_delay"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidance_entry_translationX"
- android:valueTo="@dimen/lb_guidance_entry_translationX"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_delay"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="0.0"
- android:valueType="floatType" />
- </set>
-
- <set android:ordering="together">
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_duration"
- android:interpolator="@android:interpolator/decelerate_quad"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidance_entry_translationX"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_duration"
- android:interpolator="@android:interpolator/decelerate_quad"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="1.0"
- android:valueType="floatType" />
- </set>
-
-</set>
diff --git a/v17/leanback/res/animator/lb_guidedactions_entry.xml b/v17/leanback/res/animator/lb_guidedactions_entry.xml
deleted file mode 100644
index ec6c655..0000000
--- a/v17/leanback/res/animator/lb_guidedactions_entry.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="sequentially">
-
- <set android:ordering="together">
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_delay"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidedactions_entry_translationX"
- android:valueTo="@dimen/lb_guidedactions_entry_translationX"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_delay"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="0.0"
- android:valueType="floatType" />
- </set>
-
- <set android:ordering="together">
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_duration"
- android:interpolator="@android:interpolator/decelerate_quad"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidedactions_entry_translationX"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@integer/lb_guidedstep_entry_animation_duration"
- android:interpolator="@android:interpolator/decelerate_quad"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="1.0"
- android:valueType="floatType" />
- </set>
-</set>
\ No newline at end of file
diff --git a/v17/leanback/res/animator/lb_guidedstep_slide_in_from_end.xml b/v17/leanback/res/animator/lb_guidedstep_slide_in_from_end.xml
deleted file mode 100644
index 1dacdbc..0000000
--- a/v17/leanback/res/animator/lb_guidedstep_slide_in_from_end.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="together" >
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidedstep_slide_end_distance"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="1.0"
- android:valueType="floatType" />
-
-</set>
diff --git a/v17/leanback/res/animator/lb_guidedstep_slide_in_from_start.xml b/v17/leanback/res/animator/lb_guidedstep_slide_in_from_start.xml
deleted file mode 100644
index 3c01324..0000000
--- a/v17/leanback/res/animator/lb_guidedstep_slide_in_from_start.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="together" >
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="translationX"
- android:valueFrom="@dimen/lb_guidedstep_slide_start_distance"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="alpha"
- android:valueFrom="0.0"
- android:valueTo="1.0"
- android:valueType="floatType" />
-
-</set>
diff --git a/v17/leanback/res/animator/lb_guidedstep_slide_out_to_end.xml b/v17/leanback/res/animator/lb_guidedstep_slide_out_to_end.xml
deleted file mode 100644
index 879a0cf..0000000
--- a/v17/leanback/res/animator/lb_guidedstep_slide_out_to_end.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="together" >
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="translationX"
- android:valueFrom="0.0"
- android:valueTo="@dimen/lb_guidedstep_slide_end_distance"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="alpha"
- android:valueFrom="1.0"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
-</set>
diff --git a/v17/leanback/res/animator/lb_guidedstep_slide_out_to_start.xml b/v17/leanback/res/animator/lb_guidedstep_slide_out_to_start.xml
deleted file mode 100644
index 4c9af82..0000000
--- a/v17/leanback/res/animator/lb_guidedstep_slide_out_to_start.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 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:ordering="together" >
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="translationX"
- android:valueFrom="0.0"
- android:valueTo="@dimen/lb_guidedstep_slide_start_distance"
- android:valueType="floatType" />
-
- <objectAnimator
- android:duration="@android:integer/config_longAnimTime"
- android:propertyName="alpha"
- android:valueFrom="1.0"
- android:valueTo="0.0"
- android:valueType="floatType" />
-
-</set>
diff --git a/v17/leanback/res/layout/lb_guidedactions.xml b/v17/leanback/res/layout/lb_guidedactions.xml
index 43617c9..f1a4d2a 100644
--- a/v17/leanback/res/layout/lb_guidedactions.xml
+++ b/v17/leanback/res/layout/lb_guidedactions.xml
@@ -17,19 +17,21 @@
<!-- Layout for the settings list fragment -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="match_parent">
- <RelativeLayout
- style="?attr/guidedActionsContainerStyle" >
+ <android.support.v17.leanback.widget.NonOverlappingRelativeLayout
+ android:id="@+id/guidedactions_background"
+ android:transitionGroup="true"
+ style="?attr/guidedActionsContainerStyle" />
- <FrameLayout
- android:id="@+id/guidedactions_selector"
- style="?attr/guidedActionsSelectorStyle" />
+ <android.support.v17.leanback.widget.NonOverlappingFrameLayout
+ android:id="@+id/guidedactions_selector"
+ android:transitionGroup="true"
+ style="?attr/guidedActionsSelectorStyle" />
- <android.support.v17.leanback.widget.VerticalGridView
- android:id="@+id/guidedactions_list"
- style="?attr/guidedActionsListStyle" />
-
- </RelativeLayout>
+ <android.support.v17.leanback.widget.VerticalGridView
+ android:transitionGroup="true"
+ android:id="@+id/guidedactions_list"
+ style="?attr/guidedActionsListStyle" />
</RelativeLayout>
diff --git a/v17/leanback/res/layout/lb_guidedstep_background.xml b/v17/leanback/res/layout/lb_guidedstep_background.xml
new file mode 100644
index 0000000..66b68c4
--- /dev/null
+++ b/v17/leanback/res/layout/lb_guidedstep_background.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+<android.support.v17.leanback.widget.NonOverlappingView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/guidedstep_background"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="?attr/guidedStepBackground" />
+
diff --git a/v17/leanback/res/layout/lb_guidedstep_fragment.xml b/v17/leanback/res/layout/lb_guidedstep_fragment.xml
index 6e0b7ad..5e23c80 100644
--- a/v17/leanback/res/layout/lb_guidedstep_fragment.xml
+++ b/v17/leanback/res/layout/lb_guidedstep_fragment.xml
@@ -28,7 +28,11 @@
<FrameLayout
android:id="@+id/action_fragment"
- android:layout_width="@dimen/lb_guidedactions_section_width_with_shadow"
+ android:layout_toEndOf="@+id/content_fragment"
+ android:clipToPadding="false"
+ android:clipChildren="false"
+ android:paddingLeft="@dimen/lb_guidedactions_section_shadow_width"
+ android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentEnd="true" />
diff --git a/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml
new file mode 100644
index 0000000..d2d7afa
--- /dev/null
+++ b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml
@@ -0,0 +1,40 @@
+<?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");
+ 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.
+-->
+
+<transitionSet xmlns:android="http://schemas.android.com/apk/res/android" >
+ <slide
+ android:interpolator="@android:interpolator/fast_out_linear_in"
+ android:duration="350"
+ android:slideEdge="left">
+ <targets>
+ <target android:targetId="@id/guidance_icon" />
+ <target android:targetId="@id/guidance_title" />
+ <target android:targetId="@id/guidance_breadcrumb" />
+ <target android:targetId="@id/guidance_description" />
+ </targets>
+ </slide>
+ <slide
+ android:interpolator="@android:interpolator/fast_out_linear_in"
+ android:duration="350"
+ android:slideEdge="right">
+ <targets>
+ <target android:targetId="@id/guidedactions_background" />
+ <target android:targetId="@id/guidedactions_selector" />
+ <target android:targetId="@id/guidedactions_list" />
+ </targets>
+ </slide>
+</transitionSet>
\ No newline at end of file
diff --git a/v17/leanback/res/values/attrs.xml b/v17/leanback/res/values/attrs.xml
index 10ee282..551e3f4 100644
--- a/v17/leanback/res/values/attrs.xml
+++ b/v17/leanback/res/values/attrs.xml
@@ -312,22 +312,9 @@
Theme attribute used to inspect theme inheritance. -->
<attr name="guidedStepThemeFlag" format="boolean" />
- <!-- Theme attribute for the animation used when a guided step element is animated in on
- fragment stack push. Default is {@link
- android.support.v17.leanback.R.animator#lb_guidedstep_slide_in_from_end}. -->
- <attr name="guidedStepEntryAnimation" format="reference" />
- <!-- Theme attribute for the animation used when a guided step element is animated out on
- fragment stack push. Default is {@link
- android.support.v17.leanback.R.animator#lb_guidedstep_slide_out_to_start}. -->
- <attr name="guidedStepExitAnimation" format="reference" />
- <!-- Theme attribute for the animation used when a guided step element is animated in on
- fragment stack pop. Default is {@link
- android.support.v17.leanback.R.animator#lb_guidedstep_slide_in_from_start}. -->
- <attr name="guidedStepReentryAnimation" format="reference" />
- <!-- Theme attribute for the animation used when a guided step element is animated out on
- fragment stack pop. Default is {@link
- android.support.v17.leanback.R.animator#lb_guidedstep_slide_out_to_end}. -->
- <attr name="guidedStepReturnAnimation" format="reference" />
+ <!-- Theme attribute of background drawable used by GuidedStepFragment. -->
+ <attr name="guidedStepBackground" format="reference|color" />
+
<!-- Theme attribute for the animation used when a guided step element is animated in
response to the IME appearing. Default is {@link
android.support.v17.leanback.R.animator#lb_guidedstep_slide_up}. -->
@@ -337,10 +324,6 @@
android.support.v17.leanback.R.animator#lb_guidedstep_slide_down}. -->
<attr name="guidedStepImeDisappearingAnimation" format="reference" />
- <!-- Theme attribute for the animation used when the guidance is animated in at activity
- start. Default is {@link android.support.v17.leanback.R.animator#lb_guidance_entry}.
- -->
- <attr name="guidanceEntryAnimation" format="reference" />
<!-- Theme attribute for the style of the main container in a GuidanceStylist. Default is
{@link android.support.v17.leanback.R.style#Widget_Leanback_GuidanceContainerStyle}.-->
<attr name="guidanceContainerStyle" format="reference" />
@@ -357,10 +340,6 @@
{@link android.support.v17.leanback.R.style#Widget_Leanback_GuidanceIconStyle}. -->
<attr name="guidanceIconStyle" format="reference" />
- <!-- Theme attribute for the animation used in a GuidedActionsPresenter when the actions
- list is animated in at activity start. Default is {@link
- android.support.v17.leanback.R.animator#lb_guidedactions_entry}. -->
- <attr name="guidedActionsEntryAnimation" format="reference" />
<!-- Theme attribute for the animation used in a GuidedActionsPresenter when the action
selector is animated in at activity start. Default is {@link
android.support.v17.leanback.R.animator#lb_guidedactions_selector_show}. -->
diff --git a/v17/leanback/res/values/dimens.xml b/v17/leanback/res/values/dimens.xml
index a05a6fc..8b10d5d 100644
--- a/v17/leanback/res/values/dimens.xml
+++ b/v17/leanback/res/values/dimens.xml
@@ -233,7 +233,7 @@
<dimen name="lb_guidedactions_entry_translationX">384dp</dimen>
<dimen name="lb_guidedactions_section_width">384dp</dimen>
- <dimen name="lb_guidedactions_section_width_with_shadow">400dp</dimen>
+ <dimen name="lb_guidedactions_section_shadow_width">16dp</dimen>
<dimen name="lb_guidedactions_elevation">12dp</dimen>
<dimen name="lb_guidedactions_selector_min_height">8dp</dimen>
<dimen name="lb_guidedactions_vertical_padding">12dp</dimen>
diff --git a/v17/leanback/res/values/ids.xml b/v17/leanback/res/values/ids.xml
index 8bc7324..b9da732 100644
--- a/v17/leanback/res/values/ids.xml
+++ b/v17/leanback/res/values/ids.xml
@@ -20,6 +20,8 @@
<item type="id" name="lb_slide_transition_value" />
<item type="id" name="transitionPosition" />
+ <item type="id" name="lb_guidedstep_background" />
+
<item type="id" name="lb_control_play_pause" />
<item type="id" name="lb_control_fast_forward" />
<item type="id" name="lb_control_fast_rewind" />
diff --git a/v17/leanback/res/values/styles.xml b/v17/leanback/res/values/styles.xml
index 31b44e0..447ad22 100644
--- a/v17/leanback/res/values/styles.xml
+++ b/v17/leanback/res/values/styles.xml
@@ -424,15 +424,16 @@
<!-- Style for the container view in a GuidedActionsStylist's default layout. -->
<style name="Widget.Leanback.GuidedActionsContainerStyle">
+ <item name="android:elevation">@dimen/lb_guidedactions_elevation</item>
<item name="android:layout_width">@dimen/lb_guidedactions_section_width</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_alignParentEnd">true</item>
<item name="android:background">@color/lb_guidedactions_background</item>
- <item name="android:elevation">@dimen/lb_guidedactions_elevation</item>
</style>
<!-- Style for the selector view in a GuidedActionsStylist's default layout. -->
<style name="Widget.Leanback.GuidedActionsSelectorStyle">
+ <item name="android:elevation">@dimen/lb_guidedactions_elevation</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/lb_guidedactions_selector_min_height</item>
<item name="android:layout_centerVertical">true</item>
@@ -442,6 +443,7 @@
<!-- Style for the vertical grid of actions in a GuidedActionsStylist's default layout. -->
<style name="Widget.Leanback.GuidedActionsListStyle">
+ <item name="android:elevation">@dimen/lb_guidedactions_elevation</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:focusable">true</item>
diff --git a/v17/leanback/res/values/themes.xml b/v17/leanback/res/values/themes.xml
index d994b3f..2e47e56 100644
--- a/v17/leanback/res/values/themes.xml
+++ b/v17/leanback/res/values/themes.xml
@@ -116,14 +116,12 @@
<style name="Theme.Leanback.GuidedStep" parent="Theme.LeanbackBase">
<item name="guidedStepThemeFlag">true</item>
- <item name="guidedStepEntryAnimation">@animator/lb_guidedstep_slide_in_from_end</item>
- <item name="guidedStepExitAnimation">@animator/lb_guidedstep_slide_out_to_start</item>
- <item name="guidedStepReentryAnimation">@animator/lb_guidedstep_slide_in_from_start</item>
- <item name="guidedStepReturnAnimation">@animator/lb_guidedstep_slide_out_to_end</item>
+ <item name="android:windowEnterTransition">@transition/lb_guidedstep_activity_enter</item>
+
+ <item name="guidedStepBackground">?android:attr/windowBackground</item>
+
<item name="guidedStepImeAppearingAnimation">@animator/lb_guidedstep_slide_up</item>
<item name="guidedStepImeDisappearingAnimation">@animator/lb_guidedstep_slide_down</item>
- <item name="guidanceEntryAnimation">@animator/lb_guidance_entry</item>
- <item name="guidedActionsEntryAnimation">@animator/lb_guidedactions_entry</item>
<item name="guidanceContainerStyle">@style/Widget.Leanback.GuidanceContainerStyle</item>
<item name="guidanceIconStyle">@style/Widget.Leanback.GuidanceIconStyle</item>
diff --git a/v17/leanback/src/android/support/v17/leanback/animation/UntargetableAnimatorSet.java b/v17/leanback/src/android/support/v17/leanback/animation/UntargetableAnimatorSet.java
deleted file mode 100644
index 9cdbc0c..0000000
--- a/v17/leanback/src/android/support/v17/leanback/animation/UntargetableAnimatorSet.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-package android.support.v17.leanback.animation;
-
-import android.animation.Animator;
-import android.animation.AnimatorSet;
-import android.animation.TimeInterpolator;
-
-import java.util.ArrayList;
-
-/**
- * Custom fragment animations supplied by Fragment.onCreateAnimator have their targets set to the
- * fragment's main view by the fragment manager. Sometimes, this isn't what you want; you may be
- * supplying a heterogeneous collection of animations that already have targets. This class helps
- * you return such a collection of animations from onCreateAnimator without having their targets
- * reset.
- *
- * Note that one does not simply subclass AnimatorSet and override setTarget() because AnimatorSet
- * is final.
- * @hide
- */
-public class UntargetableAnimatorSet extends Animator {
-
- private final AnimatorSet mAnimatorSet;
-
- public UntargetableAnimatorSet(AnimatorSet animatorSet) {
- mAnimatorSet = animatorSet;
- }
-
- @Override
- public void addListener(Animator.AnimatorListener listener) {
- mAnimatorSet.addListener(listener);
- }
-
- @Override
- public void cancel() {
- mAnimatorSet.cancel();
- }
-
- @Override
- public Animator clone() {
- return mAnimatorSet.clone();
- }
-
- @Override
- public void end() {
- mAnimatorSet.end();
- }
-
- @Override
- public long getDuration() {
- return mAnimatorSet.getDuration();
- }
-
- @Override
- public ArrayList<Animator.AnimatorListener> getListeners() {
- return mAnimatorSet.getListeners();
- }
-
- @Override
- public long getStartDelay() {
- return mAnimatorSet.getStartDelay();
- }
-
- @Override
- public boolean isRunning() {
- return mAnimatorSet.isRunning();
- }
-
- @Override
- public boolean isStarted() {
- return mAnimatorSet.isStarted();
- }
-
- @Override
- public void removeAllListeners() {
- mAnimatorSet.removeAllListeners();
- }
-
- @Override
- public void removeListener(Animator.AnimatorListener listener) {
- mAnimatorSet.removeListener(listener);
- }
-
- @Override
- public Animator setDuration(long duration) {
- return mAnimatorSet.setDuration(duration);
- }
-
- @Override
- public void setInterpolator(TimeInterpolator value) {
- mAnimatorSet.setInterpolator(value);
- }
-
- @Override
- public void setStartDelay(long startDelay) {
- mAnimatorSet.setStartDelay(startDelay);
- }
-
- @Override
- public void setTarget(Object target) {
- // ignore
- }
-
- @Override
- public void setupEndValues() {
- mAnimatorSet.setupEndValues();
- }
-
- @Override
- public void setupStartValues() {
- mAnimatorSet.setupStartValues();
- }
-
- @Override
- public void start() {
- mAnimatorSet.start();
- }
-}
-
diff --git a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
index 170aa63..416d418 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/GuidedStepFragment.java
@@ -21,9 +21,10 @@
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.res.TypedArray;
+import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
-import android.support.v17.leanback.animation.UntargetableAnimatorSet;
+import android.support.v17.leanback.transition.TransitionHelper;
import android.support.v17.leanback.R;
import android.support.v17.leanback.widget.GuidanceStylist;
import android.support.v17.leanback.widget.GuidanceStylist.Guidance;
@@ -34,6 +35,7 @@
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
+import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -52,7 +54,7 @@
* <p>
* <h3>Basic Usage</h3>
* <p>
- * Clients of GuidedStepFragment typically create a custom subclass to attach to their Activities.
+ * Clients of GuidedStepFragment must create a custom subclass to attach to their Activities.
* This custom subclass provides the information necessary to construct the user interface and
* respond to user actions. At a minimum, subclasses should override:
* <ul>
@@ -61,6 +63,14 @@
* <li>{@link #onGuidedActionClicked}, to respond to those actions</li>
* </ul>
* <p>
+ * Clients use following helper functions to add GuidedStepFragment to Activity or FragmentManager:
+ * <ul>
+ * <li>{@link #addAsRoot(Activity, GuidedStepFragment, int)}, to be called during Activity onCreate,
+ * adds GuidedStepFragment as the first Fragment in activity.</li>
+ * <li>{@link #add(FragmentManager, GuidedStepFragment)} or {@link #add(FragmentManager,
+ * GuidedStepFragment, int)}, to add GuidedStepFragment on top of existing Fragments or
+ * replacing existing GuidedStepFragment when moving forward to next step.</li>
+ * </ul>
* <h3>Theming and Stylists</h3>
* <p>
* GuidedStepFragment delegates its visual styling to classes called stylists. The {@link
@@ -106,8 +116,9 @@
* <p>
* <i>Note: Currently GuidedStepFragments grouped in this way must all be defined programmatically,
* rather than in XML. This restriction may be removed in the future.</i>
- * <p>
+ *
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepTheme
+ * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepBackground
* @see GuidanceStylist
* @see GuidanceStylist.Guidance
* @see GuidedAction
@@ -118,24 +129,77 @@
private static final String TAG_LEAN_BACK_ACTIONS_FRAGMENT = "leanBackGuidedStepFragment";
private static final String EXTRA_ACTION_SELECTED_INDEX = "selectedIndex";
- private static final String EXTRA_ACTION_ENTRY_TRANSITION_ENABLED = "entryTransitionEnabled";
- private static final String EXTRA_ENTRY_TRANSITION_PERFORMED = "entryTransitionPerformed";
+
+ /**
+ * Fragment argument name for UI style. The argument value is persisted in fragment state.
+ * The value is initially {@link #UI_STYLE_DEFAULT} and might be changed in one of the three
+ * helper functions:
+ * <ul>
+ * <li>{@link #addAsRoot(Activity, GuidedStepFragment, int)}</li>
+ * <li>{@link #add(FragmentManager, GuidedStepFragment)} or {@link #add(FragmentManager,
+ * GuidedStepFragment, int)}</li>
+ * </ul>
+ * <p>
+ * Argument value can be either:
+ * <ul>
+ * <li>{@link #UI_STYLE_DEFAULT}</li>
+ * <li>{@link #UI_STYLE_ENTRANCE}</li>
+ * <li>{@link #UI_STYLE_ACTIVITY_ROOT}</li>
+ * </ul>
+ */
+ public static final String EXTRA_UI_STYLE = "uiStyle";
+
+ /**
+ * Default argument value for argument {@link #EXTRA_UI_STYLE}. This the default value assigned
+ * in GuidedStepFragment constructor. This is the case that we use GuidedStepFragment to
+ * replace another existing GuidedStepFragment when moving forward to next step. Default
+ * behavior of this style is:
+ * <ul>
+ * <li> Enter transition slides in from END(right), exit transition slide out to START(left).
+ * </li>
+ * <li> No background, see {@link #onProvideBackgroundFragment()}.</li>
+ * </ul>
+ */
+ public static final int UI_STYLE_DEFAULT = 0;
+
+ /**
+ * Argument value for argument {@link #EXTRA_UI_STYLE}. This is the case that we show
+ * GuidedStepFragment on top of other content. The default behavior of this style:
+ * <ul>
+ * <li>Enter transition slides in from two sides, exit transition is inherited from
+ * {@link #UI_STYLE_DEFAULT}. Note: Changing exit transition by uiStyle is not working because
+ * fragment transition asks for exit transition before uiStyle is restored in Fragment
+ * .onCreate().</li>
+ * <li> {@link #onProvideBackgroundFragment()} will create {@link GuidedStepBackgroundFragment}
+ * to covering underneath content.</li>
+ * </ul>
+ */
+ public static final int UI_STYLE_ENTRANCE = 1;
+
+ /**
+ * Argument value for argument {@link #EXTRA_UI_STYLE}. This is the case that we show first
+ * GuidedStepFragment in a separate activity. The default behavior of this style:
+ * <ul>
+ * <li> Enter transition is assigned null (will rely on activity transition), exit transition is
+ * same as {@link #UI_STYLE_DEFAULT}. Note: Changing exit transition by ui style is not working
+ * because fragment transition asks for exit transition before uiStyle is restored in
+ * Fragment.onCreate().</li>
+ * <li> No background, see {@link #onProvideBackgroundFragment()}.
+ * </ul>
+ */
+ public static final int UI_STYLE_ACTIVITY_ROOT = 2;
+
private static final String TAG = "GuidedStepFragment";
- private static final boolean DEBUG = true;
- private static final int ANIMATION_FRAGMENT_ENTER = 1;
- private static final int ANIMATION_FRAGMENT_EXIT = 2;
- private static final int ANIMATION_FRAGMENT_ENTER_POP = 3;
- private static final int ANIMATION_FRAGMENT_EXIT_POP = 4;
+ private static final boolean DEBUG = false;
private int mTheme;
+ private ContextThemeWrapper mThemeWrapper;
private GuidanceStylist mGuidanceStylist;
private GuidedActionsStylist mActionsStylist;
private GuidedActionAdapter mAdapter;
private VerticalGridView mListView;
private List<GuidedAction> mActions = new ArrayList<GuidedAction>();
private int mSelectedIndex = -1;
- private boolean mEntryTransitionPerformed;
- private boolean mEntryTransitionEnabled = true;
public GuidedStepFragment() {
// We need to supply the theme before any potential call to onInflate in order
@@ -143,6 +207,7 @@
mTheme = onProvideTheme();
mGuidanceStylist = onCreateGuidanceStylist();
mActionsStylist = onCreateActionsStylist();
+ onProvideFragmentTransitions();
}
/**
@@ -218,7 +283,10 @@
/**
* Adds the specified GuidedStepFragment to the fragment stack, replacing any existing
- * GuidedStepFragments in the stack, and configuring the fragment-to-fragment custom animations.
+ * GuidedStepFragments in the stack, and configuring the fragment-to-fragment custom
+ * transitions.
+ * <li>If current fragment on stack is GuidedStepFragment: assign {@link #UI_STYLE_DEFAULT}
+ * <li>If current fragment on stack is not GuidedStepFragment: assign {@link #UI_STYLE_ENTRANCE}
* <p>
* Note: currently fragments added using this method must be created programmatically rather
* than via XML.
@@ -230,19 +298,61 @@
return add(fragmentManager, fragment, android.R.id.content);
}
- // Note, this method used to be public, but I haven't found a good way for a client
- // to specify an id.
- private static int add(FragmentManager fm, GuidedStepFragment f, int id) {
- boolean inGuidedStep = getCurrentGuidedStepFragment(fm) != null;
- FragmentTransaction ft = fm.beginTransaction();
+ /**
+ * Adds the specified GuidedStepFragment to the fragment stack, replacing any existing
+ * GuidedStepFragments in the stack, and configuring the fragment-to-fragment custom
+ * transitions.
+ * <li>If current fragment on stack is GuidedStepFragment: assign {@link #UI_STYLE_DEFAULT}
+ * <li>If current fragment on stack is not GuidedStepFragment: assign {@link #UI_STYLE_ENTRANCE}
+ * <p>
+ * Note: currently fragments added using this method must be created programmatically rather
+ * than via XML.
+ * @param fragmentManager The FragmentManager to be used in the transaction.
+ * @param fragment The GuidedStepFragment to be inserted into the fragment stack.
+ * @param id The id of container to add GuidedStepFragment, can be android.R.id.content.
+ * @return The ID returned by the call FragmentTransaction.replace.
+ */
+ public static int add(FragmentManager fragmentManager, GuidedStepFragment fragment, int id) {
+ boolean inGuidedStep = getCurrentGuidedStepFragment(fragmentManager) != null;
+ FragmentTransaction ft = fragmentManager.beginTransaction();
- if (inGuidedStep) {
- ft.setCustomAnimations(ANIMATION_FRAGMENT_ENTER,
- ANIMATION_FRAGMENT_EXIT, ANIMATION_FRAGMENT_ENTER_POP,
- ANIMATION_FRAGMENT_EXIT_POP);
- ft.addToBackStack(null);
+ ft.addToBackStack(null);
+ fragment.setUiStyle(inGuidedStep ? UI_STYLE_DEFAULT : UI_STYLE_ENTRANCE);
+ initialBackground(fragment, id, ft);
+ return ft.replace(id, fragment, TAG_LEAN_BACK_ACTIONS_FRAGMENT).commit();
+ }
+
+ /**
+ * Adds the specified GuidedStepFragment as content of Activity.
+ * {@link #UI_STYLE_ACTIVITY_ROOT} is assigned.
+ *
+ * Note: currently fragments added using this method must be created programmatically rather
+ * than via XML.
+ * @param activity The Activity to be used to insert GuidedstepFragment.
+ * @param fragment The GuidedStepFragment to be inserted into the fragment stack.
+ * @param id The id of container to add GuidedStepFragment, can be android.R.id.content.
+ * @return The ID returned by the call FragmentTransaction.replace.
+ */
+ public static int addAsRoot(Activity activity, GuidedStepFragment fragment, int id) {
+ // Workaround b/23764120: call getDecorView() to force requestFeature of ActivityTransition.
+ activity.getWindow().getDecorView();
+
+ FragmentManager fragmentManager = activity.getFragmentManager();
+ FragmentTransaction ft = fragmentManager.beginTransaction();
+ fragment.setUiStyle(UI_STYLE_ACTIVITY_ROOT);
+ initialBackground(fragment, id, ft);
+ return ft.replace(id, fragment, TAG_LEAN_BACK_ACTIONS_FRAGMENT).commit();
+ }
+
+ static void initialBackground(GuidedStepFragment fragment, int id, FragmentTransaction ft) {
+ Fragment backgroundFragment = fragment.onProvideBackgroundFragment();
+ if (backgroundFragment != null) {
+ if (Build.VERSION.SDK_INT < 23) {
+ // workaround b/22631964
+ ft.replace(id, new DummyFragment());
+ }
+ ft.replace(fragment.getContainerIdForBackground(), backgroundFragment);
}
- return ft.replace(id, f, TAG_LEAN_BACK_ACTIONS_FRAGMENT).commit();
}
/**
@@ -258,6 +368,20 @@
}
/**
+ * @hide
+ */
+ public static class DummyFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ final View v = new View(inflater.getContext());
+ v.setVisibility(View.GONE);
+ return v;
+ }
+ }
+
+ /**
* Returns the GuidanceStylist that displays guidance information for the user.
* @return The GuidanceStylist for this fragment.
*/
@@ -320,19 +444,171 @@
}
/**
+ * Called by Constructor to provide fragment transitions. Default implementation creates
+ * a short slide and fade transition in code for {@link #UI_STYLE_DEFAULT} for both enter and
+ * exit transition. When using style {@link #UI_STYLE_ENTRANCE}, enter transition is set
+ * to slide from both sides. When using style {@link #UI_STYLE_ACTIVITY_ROOT}, enter
+ * transition is set to null and you should rely on activity transition.
+ * <p>
+ * Subclass may override and set its own fragment transition. Note that because Context is not
+ * available when onProvideFragmentTransitions() is called, subclass will need use a cached
+ * static application context to load transition from xml. Because the fragment view is
+ * removed during fragment transition, in general app cannot use two Visibility transition
+ * together. Workaround is to create your own Visibility transition that controls multiple
+ * animators (e.g. slide and fade animation in one Transition class).
+ */
+ protected void onProvideFragmentTransitions() {
+ if (Build.VERSION.SDK_INT >= 21) {
+ TransitionHelper helper = TransitionHelper.getInstance();
+ if (getUiStyle() == UI_STYLE_DEFAULT) {
+ Object enterTransition = helper.createFadeAndShortSlide(Gravity.END);
+ helper.exclude(enterTransition, R.id.guidedactions_background, true);
+ helper.exclude(enterTransition, R.id.guidedactions_selector, true);
+ TransitionHelper.getInstance().setEnterTransition(this, enterTransition);
+ Object exitTransition = helper.createFadeAndShortSlide(Gravity.START);
+ helper.exclude(exitTransition, R.id.guidedactions_background, true);
+ helper.exclude(exitTransition, R.id.guidedactions_selector, true);
+ TransitionHelper.getInstance().setExitTransition(this, exitTransition);
+ } else if (getUiStyle() == UI_STYLE_ENTRANCE) {
+ // TODO implement slide from/to two sides
+ Object enterTransition = helper.createFadeAndShortSlide(Gravity.END);
+ helper.exclude(enterTransition, R.id.guidedactions_background, true);
+ helper.exclude(enterTransition, R.id.guidedactions_selector, true);
+ TransitionHelper.getInstance().setEnterTransition(this, enterTransition);
+ // exit transition is unchanged, same as UI_STYLE_DEFAULT
+ } else if (getUiStyle() == UI_STYLE_ACTIVITY_ROOT) {
+ // for Activity root, we dont need enter transition, use activity transition
+ TransitionHelper.getInstance().setEnterTransition(this, null);
+ // exit transition is unchanged, same as UI_STYLE_DEFAULT
+ }
+ }
+ }
+
+ /**
+ * Default implementation of background for covering content bellow GuidedStepFragment.
+ * It uses current theme attribute guidedStepBackground which by default is read from
+ * android:windowBackground.
+ */
+ public static class GuidedStepBackgroundFragment extends Fragment {
+ public GuidedStepBackgroundFragment() {
+ onProvideFragmentTransitions();
+ }
+
+ /**
+ * Sets fragment transitions for GuidedStepBackgroundFragment. Can be overridden.
+ */
+ protected void onProvideFragmentTransitions() {
+ if (Build.VERSION.SDK_INT >= 21) {
+ TransitionHelper helper = TransitionHelper.getInstance();
+ Object enterTransition = helper.createFadeTransition(
+ TransitionHelper.FADE_IN|TransitionHelper.FADE_OUT);
+ TransitionHelper.getInstance().setEnterTransition(this, enterTransition);
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ Activity activity = getActivity();
+ Context themedContext = null;
+ if (!isGuidedStepTheme(activity)) {
+ // Look up the guidedStepTheme in the activity's currently specified theme. If it
+ // exists, replace the theme with its value.
+ int resId = R.attr.guidedStepTheme;
+ TypedValue typedValue = new TypedValue();
+ boolean found = activity.getTheme().resolveAttribute(resId, typedValue, true);
+ if (DEBUG) Log.v(TAG, "Found guided step theme reference? " + found);
+ if (found) {
+ ContextThemeWrapper themeWrapper =
+ new ContextThemeWrapper(activity, typedValue.resourceId);
+ if (isGuidedStepTheme(themeWrapper)) {
+ themedContext = themeWrapper;
+ }
+ }
+ if (!found) {
+ Log.e(TAG, "GuidedStepFragment does not have an appropriate theme set.");
+ }
+ }
+
+ if (themedContext != null) {
+ inflater = inflater.cloneInContext(themedContext);
+ }
+
+ return inflater.inflate(R.layout.lb_guidedstep_background, container, false);
+ }
+ }
+
+ /**
+ * Creates a background fragment for {@link #UI_STYLE_ENTRANCE}, returns null for other cases.
+ * Subclass may override the default behavior, e.g. provide different backgrounds
+ * for {@link #UI_STYLE_DEFAULT}. Background fragment will be inserted in {@link
+ * #getContainerIdForBackground()}.
+ *
+ * @return fragment that will be inserted bellow GuidedStepFragment.
+ */
+ protected Fragment onProvideBackgroundFragment() {
+ if (getUiStyle() == UI_STYLE_ENTRANCE) {
+ return new GuidedStepBackgroundFragment();
+ }
+ return null;
+ }
+
+ /**
+ * Returns container id for inserting {@link #onProvideBackgroundFragment()}. The id should be
+ * different than container id for inserting GuidedStepFragment.
+ * Default value is {@link R.id#lb_guidedstep_background}. Subclass may override.
+ * @return container id for inserting {@link #onProvideBackgroundFragment()}
+ */
+ protected int getContainerIdForBackground() {
+ return R.id.lb_guidedstep_background;
+ }
+
+
+ /**
+ * Set UI style to fragment arguments, UI style cannot be changed after initialization.
+ * @param style {@link #UI_STYLE_ACTIVITY_ROOT} {@link #UI_STYLE_DEFAULT} or
+ * {@link #UI_STYLE_ENTRANCE}.
+ */
+ public void setUiStyle(int style) {
+ int oldStyle = getUiStyle();
+ Bundle arguments = getArguments();
+ if (arguments == null) {
+ arguments = new Bundle();
+ }
+ arguments.putInt(EXTRA_UI_STYLE, style);
+ // call setArgument() will validate if the fragment is already added.
+ setArguments(arguments);
+ if (style != oldStyle) {
+ onProvideFragmentTransitions();
+ }
+ }
+
+ /**
+ * Read UI style from fragment arguments.
+ *
+ * @return {@link #UI_STYLE_ACTIVITY_ROOT} {@link #UI_STYLE_DEFAULT} or
+ * {@link #UI_STYLE_ENTRANCE}.
+ */
+ public int getUiStyle() {
+ Bundle b = getArguments();
+ if (b == null) return UI_STYLE_DEFAULT;
+ return b.getInt(EXTRA_UI_STYLE, UI_STYLE_DEFAULT);
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (DEBUG) Log.v(TAG, "onCreate");
+ // Set correct transition from saved arguments.
+ onProvideFragmentTransitions();
Bundle state = (savedInstanceState != null) ? savedInstanceState : getArguments();
if (state != null) {
if (mSelectedIndex == -1) {
mSelectedIndex = state.getInt(EXTRA_ACTION_SELECTED_INDEX, -1);
}
- mEntryTransitionEnabled = state.getBoolean(EXTRA_ACTION_ENTRY_TRANSITION_ENABLED, true);
- mEntryTransitionPerformed = state.getBoolean(EXTRA_ENTRY_TRANSITION_PERFORMED, false);
}
mActions.clear();
onCreateActions(mActions, savedInstanceState);
@@ -389,74 +665,9 @@
super.onSaveInstanceState(outState);
outState.putInt(EXTRA_ACTION_SELECTED_INDEX,
(mListView != null) ? getSelectedActionPosition() : mSelectedIndex);
- outState.putBoolean(EXTRA_ACTION_ENTRY_TRANSITION_ENABLED, mEntryTransitionEnabled);
- outState.putBoolean(EXTRA_ENTRY_TRANSITION_PERFORMED, mEntryTransitionPerformed);
}
- /**
- * {@inheritDoc}
- */
- @Override
- public void onStart() {
- if (DEBUG) Log.v(TAG, "onStart");
- super.onStart();
- if (isEntryTransitionEnabled() && !mEntryTransitionPerformed) {
- mEntryTransitionPerformed = true;
- performEntryTransition();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {
- if (DEBUG) Log.v(TAG, "onCreateAnimator: " + transit + " " + enter + " " + nextAnim);
- View mainView = getView();
-
- ArrayList<Animator> animators = new ArrayList<Animator>();
- switch (nextAnim) {
- case ANIMATION_FRAGMENT_ENTER:
- mGuidanceStylist.onFragmentEnter(animators);
- mActionsStylist.onFragmentEnter(animators);
- break;
- case ANIMATION_FRAGMENT_EXIT:
- mGuidanceStylist.onFragmentExit(animators);
- mActionsStylist.onFragmentExit(animators);
- break;
- case ANIMATION_FRAGMENT_ENTER_POP:
- mGuidanceStylist.onFragmentReenter(animators);
- mActionsStylist.onFragmentReenter(animators);
- break;
- case ANIMATION_FRAGMENT_EXIT_POP:
- mGuidanceStylist.onFragmentReturn(animators);
- mActionsStylist.onFragmentReturn(animators);
- break;
- default:
- return super.onCreateAnimator(transit, enter, nextAnim);
- }
-
- mEntryTransitionPerformed = true;
- return createDummyAnimator(mainView, animators);
- }
-
- /**
- * Returns whether entry transitions are enabled for this fragment.
- * @return Whether entry transitions are enabled for this fragment.
- */
- protected boolean isEntryTransitionEnabled() {
- return mEntryTransitionEnabled;
- }
-
- /**
- * Sets whether entry transitions are enabled for this fragment.
- * @param enabled Whether to enable entry transitions for this fragment.
- */
- protected void setEntryTransitionEnabled(boolean enabled) {
- mEntryTransitionEnabled = enabled;
- }
-
- private boolean isGuidedStepTheme(Context context) {
+ private static boolean isGuidedStepTheme(Context context) {
int resId = R.attr.guidedStepThemeFlag;
TypedValue typedValue = new TypedValue();
boolean found = context.getTheme().resolveAttribute(resId, typedValue, true);
@@ -465,7 +676,6 @@
}
private void resolveTheme() {
- boolean hasThemeReference = true;
// Look up the guidedStepTheme in the currently specified theme. If it exists,
// replace the theme with its value.
Activity activity = getActivity();
@@ -477,15 +687,21 @@
boolean found = activity.getTheme().resolveAttribute(resId, typedValue, true);
if (DEBUG) Log.v(TAG, "Found guided step theme reference? " + found);
if (found) {
- if (isGuidedStepTheme(new ContextThemeWrapper(activity, typedValue.resourceId))) {
+ ContextThemeWrapper themeWrapper =
+ new ContextThemeWrapper(activity, typedValue.resourceId);
+ if (isGuidedStepTheme(themeWrapper)) {
mTheme = typedValue.resourceId;
+ mThemeWrapper = themeWrapper;
} else {
found = false;
+ mThemeWrapper = null;
}
}
if (!found) {
Log.e(TAG, "GuidedStepFragment does not have an appropriate theme set.");
}
+ } else if (mTheme != -1) {
+ mThemeWrapper = new ContextThemeWrapper(activity, mTheme);
}
}
@@ -493,8 +709,7 @@
if (mTheme == -1) {
return inflater;
} else {
- Context ctw = new ContextThemeWrapper(getActivity(), mTheme);
- return inflater.cloneInContext(ctw);
+ return inflater.cloneInContext(mThemeWrapper);
}
}
@@ -507,37 +722,6 @@
return 0;
}
- private void performEntryTransition() {
- if (DEBUG) Log.v(TAG, "performEntryTransition");
- final View mainView = getView();
-
- mainView.setVisibility(View.INVISIBLE);
-
- ArrayList<Animator> animators = new ArrayList<Animator>();
- mGuidanceStylist.onActivityEnter(animators);
- mActionsStylist.onActivityEnter(animators);
-
- final Animator animator = createDummyAnimator(mainView, animators);
-
- // We need to defer the animation until the first layout has occurred, as we don't yet
- // know the final locations of views.
- mainView.getViewTreeObserver().addOnGlobalLayoutListener(
- new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- mainView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
- if (!isAdded()) {
- // We have been detached before this could run,
- // so just bail
- return;
- }
-
- mainView.setVisibility(View.VISIBLE);
- animator.start();
- }
- });
- }
-
private void runImeAnimations(boolean entering) {
ArrayList<Animator> animators = new ArrayList<Animator>();
if (entering) {
@@ -552,10 +736,4 @@
set.start();
}
- private Animator createDummyAnimator(final View v, ArrayList<Animator> animators) {
- final AnimatorSet animatorSet = new AnimatorSet();
- animatorSet.playTogether(animators);
- return new UntargetableAnimatorSet(animatorSet);
- }
-
}
diff --git a/v17/leanback/src/android/support/v17/leanback/transition/TransitionHelper.java b/v17/leanback/src/android/support/v17/leanback/transition/TransitionHelper.java
index 1c66d03..25ba30a 100644
--- a/v17/leanback/src/android/support/v17/leanback/transition/TransitionHelper.java
+++ b/v17/leanback/src/android/support/v17/leanback/transition/TransitionHelper.java
@@ -62,6 +62,10 @@
*/
static interface TransitionHelperVersionImpl {
+ public void setEnterTransition(android.app.Fragment fragment, Object transition);
+
+ public void setExitTransition(android.app.Fragment fragment, Object transition);
+
public Object getSharedElementEnterTransition(Window window);
public Object getSharedElementReturnTransition(Window window);
@@ -90,6 +94,8 @@
public Object createChangeBounds(boolean reparent);
+ public Object createFadeAndShortSlide(int edge);
+
public void setChangeBoundsStartDelay(Object changeBounds, View view, int startDelay);
public void setChangeBoundsStartDelay(Object changeBounds, int viewId, int startDelay);
@@ -135,12 +141,18 @@
/**
* Interface used when we do not support Transition animations.
*/
- private static final class TransitionHelperStubImpl implements TransitionHelperVersionImpl {
+ static class TransitionHelperStubImpl implements TransitionHelperVersionImpl {
private static class TransitionStub {
TransitionListener mTransitionListener;
}
+ public void setEnterTransition(android.app.Fragment fragment, Object transition) {
+ }
+
+ public void setExitTransition(android.app.Fragment fragment, Object transition) {
+ }
+
@Override
public Object getSharedElementEnterTransition(Window window) {
return null;
@@ -202,6 +214,11 @@
}
@Override
+ public Object createFadeAndShortSlide(int edge) {
+ return new TransitionStub();
+ }
+
+ @Override
public Object createSlide(int slideEdge) {
return new TransitionStub();
}
@@ -311,47 +328,7 @@
/**
* Implementation used on KitKat (and above).
*/
- private static class TransitionHelperKitkatImpl implements TransitionHelperVersionImpl {
-
- @Override
- public Object getSharedElementEnterTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getSharedElementReturnTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getSharedElementExitTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getSharedElementReenterTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getEnterTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getReturnTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getExitTransition(Window window) {
- return null;
- }
-
- @Override
- public Object getReenterTransition(Window window) {
- return null;
- }
+ static class TransitionHelperKitkatImpl extends TransitionHelperStubImpl {
@Override
public Object createScene(ViewGroup sceneRoot, Runnable r) {
@@ -485,7 +462,15 @@
}
}
- private static final class TransitionHelperApi21Impl extends TransitionHelperKitkatImpl {
+ static final class TransitionHelperApi21Impl extends TransitionHelperKitkatImpl {
+
+ public void setEnterTransition(android.app.Fragment fragment, Object transition) {
+ TransitionHelperApi21.setEnterTransition(fragment, transition);
+ }
+
+ public void setExitTransition(android.app.Fragment fragment, Object transition) {
+ TransitionHelperApi21.setExitTransition(fragment, transition);
+ }
@Override
public Object getSharedElementEnterTransition(Window window) {
@@ -508,6 +493,11 @@
}
@Override
+ public Object createFadeAndShortSlide(int edge) {
+ return TransitionHelperApi21.createFadeAndShortSlide(edge);
+ }
+
+ @Override
public Object getEnterTransition(Window window) {
return TransitionHelperApi21.getEnterTransition(window);
}
@@ -691,4 +681,24 @@
public Object loadTransition(Context context, int resId) {
return mImpl.loadTransition(context, resId);
}
+
+ public void setEnterTransition(android.app.Fragment fragment, Object transition) {
+ mImpl.setEnterTransition(fragment, transition);
+ }
+
+ public void setExitTransition(android.app.Fragment fragment, Object transition) {
+ mImpl.setExitTransition(fragment, transition);
+ }
+
+ public void setEnterTransition(android.support.v4.app.Fragment fragment, Object transition) {
+ fragment.setEnterTransition(transition);
+ }
+
+ public void setExitTransition(android.support.v4.app.Fragment fragment, Object transition) {
+ fragment.setExitTransition(transition);
+ }
+
+ public Object createFadeAndShortSlide(int edge) {
+ return mImpl.createFadeAndShortSlide(edge);
+ }
}
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/FragmentAnimationProvider.java b/v17/leanback/src/android/support/v17/leanback/widget/FragmentAnimationProvider.java
index b1f6169..1c5dcb5 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/FragmentAnimationProvider.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/FragmentAnimationProvider.java
@@ -26,50 +26,6 @@
public interface FragmentAnimationProvider {
/**
- * Animates the entry of the fragment in the case where the activity is first being presented.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onActivityEnter(@NonNull List<Animator> animators);
-
- /**
- * Animates the exit of the fragment in the case where the activity is about to pause.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onActivityExit(@NonNull List<Animator> animators);
-
- /**
- * Animates the entry of the fragment in the case where there is a previous step fragment
- * participating in the animation. Entry occurs when the fragment is preparing to be shown
- * as it is pushed onto the back stack.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onFragmentEnter(@NonNull List<Animator> animators);
-
- /**
- * Animates the exit of the fragment in the case where there is a previous step fragment
- * participating in the animation. Exit occurs when the fragment is preparing to be removed,
- * hidden, or detached due to pushing another fragment onto the back stack.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onFragmentExit(@NonNull List<Animator> animators);
-
- /**
- * Animates the re-entry of the fragment in the case where there is a previous step fragment
- * participating in the animation. Re-entry occurs when the fragment is preparing to be shown
- * due to popping the back stack.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onFragmentReenter(@NonNull List<Animator> animators);
-
- /**
- * Animates the return of the fragment in the case where there is a previous step fragment
- * participating in the animation. Return occurs when the fragment is preparing to be removed,
- * hidden, or detached due to popping the back stack.
- * @param animators A list of animations to which this provider's animations should be added.
- */
- public abstract void onFragmentReturn(@NonNull List<Animator> animators);
-
- /**
* Animates the fragment in response to the IME appearing.
* @param animators A list of animations to which this provider's animations should be added.
*/
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GuidanceStylist.java b/v17/leanback/src/android/support/v17/leanback/widget/GuidanceStylist.java
index b95c114..fd05b8e 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GuidanceStylist.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GuidanceStylist.java
@@ -54,11 +54,6 @@
* </ul><p>
* View IDs are allowed to be missing, in which case the corresponding views will be null.
*
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidanceEntryAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepEntryAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepExitAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepReentryAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepReturnAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepImeAppearingAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepImeDisappearingAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidanceContainerStyle
@@ -225,67 +220,6 @@
* {@inheritDoc}
*/
@Override
- public void onActivityEnter(@NonNull List<Animator> animators) {
- addAnimator(animators, mTitleView, R.attr.guidanceEntryAnimation);
- addAnimator(animators, mBreadcrumbView, R.attr.guidanceEntryAnimation);
- addAnimator(animators, mDescriptionView, R.attr.guidanceEntryAnimation);
- addAnimator(animators, mIconView, R.attr.guidanceEntryAnimation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onActivityExit(@NonNull List<Animator> animators) {}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentEnter(@NonNull List<Animator> animators) {
- addAnimator(animators, mTitleView, R.attr.guidedStepEntryAnimation);
- addAnimator(animators, mBreadcrumbView, R.attr.guidedStepEntryAnimation);
- addAnimator(animators, mDescriptionView, R.attr.guidedStepEntryAnimation);
- addAnimator(animators, mIconView, R.attr.guidedStepEntryAnimation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentExit(@NonNull List<Animator> animators) {
- addAnimator(animators, mTitleView, R.attr.guidedStepExitAnimation);
- addAnimator(animators, mBreadcrumbView, R.attr.guidedStepExitAnimation);
- addAnimator(animators, mDescriptionView, R.attr.guidedStepExitAnimation);
- addAnimator(animators, mIconView, R.attr.guidedStepExitAnimation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentReenter(@NonNull List<Animator> animators) {
- addAnimator(animators, mTitleView, R.attr.guidedStepReentryAnimation);
- addAnimator(animators, mBreadcrumbView, R.attr.guidedStepReentryAnimation);
- addAnimator(animators, mDescriptionView, R.attr.guidedStepReentryAnimation);
- addAnimator(animators, mIconView, R.attr.guidedStepReentryAnimation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentReturn(@NonNull List<Animator> animators) {
- addAnimator(animators, mTitleView, R.attr.guidedStepReturnAnimation);
- addAnimator(animators, mBreadcrumbView, R.attr.guidedStepReturnAnimation);
- addAnimator(animators, mDescriptionView, R.attr.guidedStepReturnAnimation);
- addAnimator(animators, mIconView, R.attr.guidedStepReturnAnimation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void onImeAppearing(@NonNull List<Animator> animators) {
addAnimator(animators, mTitleView, R.attr.guidedStepImeAppearingAnimation);
addAnimator(animators, mBreadcrumbView, R.attr.guidedStepImeAppearingAnimation);
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java b/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
index 07dd4c9..ae281b8 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GuidedActionsStylist.java
@@ -87,13 +87,8 @@
* be a subclass of {@link android.widget.EditText}, and should satisfy the {@link
* ImeKeyMonitor} interface.
*
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepEntryAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepExitAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepReentryAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepReturnAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepImeAppearingAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedStepImeDisappearingAnimation
- * @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedActionsEntryAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedActionsSelectorShowAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedActionsSelectorHideAnimation
* @attr ref android.support.v17.leanback.R.styleable#LeanbackGuidedStepTheme_guidedActionsContainerStyle
@@ -459,56 +454,6 @@
* {@inheritDoc}
*/
@Override
- public void onActivityEnter(@NonNull List<Animator> animators) {
- animators.add(createAnimator(mMainView, R.attr.guidedActionsEntryAnimation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onActivityExit(@NonNull List<Animator> animators) {}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentEnter(@NonNull List<Animator> animators) {
- animators.add(createAnimator(mActionsGridView, R.attr.guidedStepEntryAnimation));
- animators.add(createAnimator(mSelectorView, R.attr.guidedStepEntryAnimation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentExit(@NonNull List<Animator> animators) {
- animators.add(createAnimator(mActionsGridView, R.attr.guidedStepExitAnimation));
- animators.add(createAnimator(mSelectorView, R.attr.guidedStepExitAnimation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentReenter(@NonNull List<Animator> animators) {
- animators.add(createAnimator(mActionsGridView, R.attr.guidedStepReentryAnimation));
- animators.add(createAnimator(mSelectorView, R.attr.guidedStepReentryAnimation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onFragmentReturn(@NonNull List<Animator> animators) {
- animators.add(createAnimator(mActionsGridView, R.attr.guidedStepReturnAnimation));
- animators.add(createAnimator(mSelectorView, R.attr.guidedStepReturnAnimation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void onImeAppearing(@NonNull List<Animator> animators) {
animators.add(createAnimator(mActionsGridView, R.attr.guidedStepImeAppearingAnimation));
animators.add(createAnimator(mSelectorView, R.attr.guidedStepImeAppearingAnimation));