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:
@@ -53,7 +53,7 @@
|
|||||||
android:theme="@style/Theme.Example.Leanback"></activity>
|
android:theme="@style/Theme.Example.Leanback"></activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".app.media.MusicExampleActivity"
|
android:name=".app.media.MusicExampleActivity"
|
||||||
android:theme="@style/Theme.Example.Leanback"></activity>
|
android:theme="@style/Theme.Example.LeanbackMusic"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="@color/card_examples_background"
|
|
||||||
android:transitionGroup="false"
|
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="@drawable/background_canyon"
|
|
||||||
android:transitionGroup="false"
|
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/detailsFragment"
|
android:id="@+id/detailsFragment"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="@drawable/background_sax"
|
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Example.LeanbackBrowse" parent="Theme.Leanback.Browse">
|
<style name="Theme.Example.LeanbackBrowse" parent="Theme.Leanback.Browse">
|
||||||
|
<item name="android:windowBackground">@color/card_examples_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Example.LeanbackVerticalGrid" parent="Theme.Leanback.VerticalGrid">
|
<style name="Theme.Example.LeanbackVerticalGrid" parent="Theme.Leanback.VerticalGrid">
|
||||||
@@ -51,5 +52,11 @@
|
|||||||
|
|
||||||
<style name="Theme.Example.LeanbackDetails" parent="Theme.Leanback.Details">
|
<style name="Theme.Example.LeanbackDetails" parent="Theme.Leanback.Details">
|
||||||
<item name="android:colorPrimary">@color/detail_view_actionbar_background</item>
|
<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>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user