diff options
| author | Dake Gu <dake@google.com> | 2015-11-13 17:01:21 -0800 |
|---|---|---|
| committer | Dake Gu <dake@google.com> | 2015-11-13 17:05:50 -0800 |
| commit | 422fa46777c4241a26ae1a811b1fb1461ffcccb9 (patch) | |
| tree | 4e38e719d595b4281f41d9b1af8fea12be546b87 | |
| parent | b94fdf773e06d30f03500c8879eb0bb061640470 (diff) | |
| download | android_frameworks_support-422fa46777c4241a26ae1a811b1fb1461ffcccb9.tar.gz android_frameworks_support-422fa46777c4241a26ae1a811b1fb1461ffcccb9.tar.bz2 android_frameworks_support-422fa46777c4241a26ae1a811b1fb1461ffcccb9.zip | |
GuidedStepFragment: fix temporary black screen in activity enter
Last CL deprecating background view causes the regression.
We need to keep the activity translucent during fade-in background view
of GuidedStepFragment. The trick is to actually set a transparent ColorDrawable
and make it last as long as the background view fade-in.
Change-Id: I53e63fe0cebf60028dc8f45dc3446407ad7a5ef0
| -rw-r--r-- | v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml | 2 | ||||
| -rw-r--r-- | v17/leanback/res/values/integers.xml | 2 | ||||
| -rw-r--r-- | v17/leanback/res/values/themes.xml | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml index ef149575d1..120f9425a1 100644 --- a/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml +++ b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml @@ -18,7 +18,7 @@ <transitionSet xmlns:android="http://schemas.android.com/apk/res/android" > <fade android:interpolator="@android:interpolator/fast_out_linear_in" - android:duration="350"> + android:duration="@integer/lb_guidedstep_activity_background_fade_duration_ms"> <targets> <target android:targetId="@id/guidedstep_background" /> </targets> diff --git a/v17/leanback/res/values/integers.xml b/v17/leanback/res/values/integers.xml index f16a7f0eff..c9f33842de 100644 --- a/v17/leanback/res/values/integers.xml +++ b/v17/leanback/res/values/integers.xml @@ -34,4 +34,6 @@ <integer name="slideEdgeStart">3</integer> <!-- Gravity.RIGHT --> <integer name="slideEdgeEnd">5</integer> + + <integer name="lb_guidedstep_activity_background_fade_duration_ms">350</integer> </resources> diff --git a/v17/leanback/res/values/themes.xml b/v17/leanback/res/values/themes.xml index 056ed1f470..82ee58d410 100644 --- a/v17/leanback/res/values/themes.xml +++ b/v17/leanback/res/values/themes.xml @@ -118,8 +118,13 @@ <item name="android:windowEnterTransition">@transition/lb_guidedstep_activity_enter</item> + <!-- background applied to each GuidedStepFragment by default--> <item name="guidedStepBackground">?android:attr/colorBackground</item> - <item name="android:windowBackground">@null</item> + <!-- Each GuidedStepFragment has a background so activity does not need a background. + But We still need a dumb background to keep the temporary translucent state last + as long as the background view fade-in transition --> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowTransitionBackgroundFadeDuration">@integer/lb_guidedstep_activity_background_fade_duration_ms</item> <item name="guidedStepImeAppearingAnimation">@animator/lb_guidedstep_slide_up</item> <item name="guidedStepImeDisappearingAnimation">@animator/lb_guidedstep_slide_down</item> |
