Merge pull request #5100 from ByteHamster/fix-flickering
Fixed tab flickering
This commit is contained in:
commit
2c4693b938
|
@ -6,24 +6,44 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<!--
|
||||||
|
While the same visuals could be achieved without this nested layout,
|
||||||
|
RelativeLayout invalidates all its direct children when the playback
|
||||||
|
position is updated. This causes flickering of the tabs every second.
|
||||||
|
-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/pagerContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="?attr/actionBarSize"
|
|
||||||
android:theme="?attr/actionBarTheme"
|
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
app:navigationIcon="?homeAsUpIndicator"
|
android:layout_above="@id/playtime_layout"
|
||||||
android:id="@+id/toolbar"/>
|
android:orientation="vertical"
|
||||||
|
android:layout_marginBottom="12dp">
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/sliding_tabs"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:minHeight="?attr/actionBarSize"
|
||||||
android:layout_below="@id/toolbar"
|
android:theme="?attr/actionBarTheme"
|
||||||
android:background="?android:attr/windowBackground"
|
app:navigationIcon="?homeAsUpIndicator"
|
||||||
app:tabBackground="?attr/selectableItemBackground"
|
android:id="@+id/toolbar"/>
|
||||||
app:tabMode="fixed"
|
|
||||||
app:tabGravity="fill"/>
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/sliding_tabs"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/windowBackground"
|
||||||
|
app:tabBackground="?attr/selectableItemBackground"
|
||||||
|
app:tabMode="fixed"
|
||||||
|
app:tabGravity="fill"/>
|
||||||
|
|
||||||
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:foreground="?android:windowContentOverlay"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/playerFragment"
|
android:id="@+id/playerFragment"
|
||||||
|
@ -34,19 +54,10 @@
|
||||||
tools:layout_height="@dimen/external_player_height"
|
tools:layout_height="@dimen/external_player_height"
|
||||||
android:elevation="8dp"/>
|
android:elevation="8dp"/>
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
|
||||||
android:id="@+id/pager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_above="@id/playtime_layout"
|
|
||||||
android:layout_below="@id/sliding_tabs"
|
|
||||||
android:foreground="?android:windowContentOverlay"
|
|
||||||
android:layout_marginBottom="12dp"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp"
|
||||||
android:layout_alignBottom="@id/pager"
|
android:layout_alignBottom="@id/pagerContainer"
|
||||||
android:src="@drawable/bg_gradient"
|
android:src="@drawable/bg_gradient"
|
||||||
app:tint="?android:attr/windowBackground"
|
app:tint="?android:attr/windowBackground"
|
||||||
android:importantForAccessibility="no"/>
|
android:importantForAccessibility="no"/>
|
||||||
|
@ -56,7 +67,7 @@
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBottom="@+id/pager"
|
android:layout_alignBottom="@+id/pagerContainer"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
app:cardCornerRadius="8dp"
|
app:cardCornerRadius="8dp"
|
||||||
|
|
Loading…
Reference in New Issue