Supportleanbackshowcase: Polishing 2 and transition performance fix

Move background of browse/details/music from layout to windowBackground.
Setting background on view will cause the whole RelativeLayout being
faded in while transition move content inside the RelativeLayout.
The RelativeLayout does not have a hardwarelayer, nor does it specify
hasOverlappingRendering=false.  This falls to the slowest rendering
path.

Change-Id: I78bacc965e641d7f960aae5cf212c29f6b1f0f11
This commit is contained in:
Dake Gu
2015-10-01 14:54:19 -07:00
parent ab2a8a7dae
commit 6fe262dae9
5 changed files with 9 additions and 7 deletions

View File

@@ -53,7 +53,7 @@
android:theme="@style/Theme.Example.Leanback"></activity>
<activity
android:name=".app.media.MusicExampleActivity"
android:theme="@style/Theme.Example.Leanback"></activity>
android:theme="@style/Theme.Example.LeanbackMusic"></activity>
</application>
</manifest>

View File

@@ -16,8 +16,6 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/card_examples_background"
android:transitionGroup="false"
android:layout_height="match_parent">
<fragment

View File

@@ -16,8 +16,6 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@drawable/background_canyon"
android:transitionGroup="false"
android:layout_height="match_parent">
<fragment
android:id="@+id/detailsFragment"

View File

@@ -16,7 +16,6 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@drawable/background_sax"
android:layout_height="match_parent">
<fragment

View File

@@ -27,6 +27,7 @@
</style>
<style name="Theme.Example.LeanbackBrowse" parent="Theme.Leanback.Browse">
<item name="android:windowBackground">@color/card_examples_background</item>
</style>
<style name="Theme.Example.LeanbackVerticalGrid" parent="Theme.Leanback.VerticalGrid">
@@ -51,5 +52,11 @@
<style name="Theme.Example.LeanbackDetails" parent="Theme.Leanback.Details">
<item name="android:colorPrimary">@color/detail_view_actionbar_background</item>
</style>
<item name="android:windowBackground">@drawable/background_canyon</item>
</style>
<style name="Theme.Example.LeanbackMusic" parent="Theme.Example.Leanback">
<item name="android:windowBackground">@drawable/background_sax</item>
</style>
</resources>