Tweak the video autoplay control UI. Set show_timeout to 1s to video autoplay control UI.

This commit is contained in:
Alex Ning 2021-08-26 20:27:19 +08:00
parent 79a7e0f6f6
commit e8386b0c4a
6 changed files with 73 additions and 43 deletions

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid
android:color="#40000000" />
<corners
android:topLeftRadius="16dp"
android:topRightRadius="16dp" />
</shape>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<size android:width="16dp" android:height="16dp"/>
<solid
android:color="#40000000" />
</shape>

View File

@ -6,17 +6,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:orientation="vertical" android:orientation="vertical">
android:background="#80000000">
<ImageView <ImageView
android:id="@+id/mute_exo_playback_control_view" android:id="@+id/mute_exo_playback_control_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="8dp"
android:layout_toStartOf="@id/fullscreen_exo_playback_control_view" android:layout_toStartOf="@id/fullscreen_exo_playback_control_view"
android:src="@drawable/ic_mute_white_rounded_24dp" android:src="@drawable/ic_mute_white_rounded_24dp"
android:background="?actionBarItemBackground" android:background="@drawable/exo_player_control_button_circular_background"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:visibility="gone" android:visibility="gone"
@ -30,10 +29,10 @@
android:id="@+id/fullscreen_exo_playback_control_view" android:id="@+id/fullscreen_exo_playback_control_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="8dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:src="@drawable/ic_fullscreen_white_rounded_24dp" android:src="@drawable/ic_fullscreen_white_rounded_24dp"
android:background="?actionBarItemBackground" android:background="@drawable/exo_player_control_button_circular_background"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -53,25 +52,34 @@
<ImageView android:id="@id/exo_play" <ImageView android:id="@id/exo_play"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="8dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@drawable/ic_play_arrow_white_rounded_24dp" android:src="@drawable/ic_play_arrow_white_rounded_24dp"
android:background="?actionBarItemBackground" android:background="@drawable/exo_player_control_button_circular_background"
android:clickable="true" android:clickable="true"
android:focusable="true" /> android:focusable="true" />
<ImageView android:id="@id/exo_pause" <ImageView android:id="@id/exo_pause"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="8dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@drawable/ic_pause_white_rounded_24dp" android:src="@drawable/ic_pause_white_rounded_24dp"
android:background="?actionBarItemBackground" android:background="@drawable/exo_player_control_button_circular_background"
android:clickable="true" android:clickable="true"
android:focusable="true" /> android:focusable="true" />
</FrameLayout> </FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:background="@drawable/background_autoplay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<TextView <TextView
android:id="@id/exo_position" android:id="@id/exo_position"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -110,3 +118,5 @@
app:bar_height="2dp" /> app:bar_height="2dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -29,6 +29,7 @@
android:id="@+id/player_view_item_post_card_2_video_autoplay" android:id="@+id/player_view_item_post_card_2_video_autoplay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:show_timeout="1000"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView <pl.droidsonroids.gif.GifImageView

View File

@ -213,6 +213,7 @@
android:id="@+id/player_view_item_post_detail_video_autoplay" android:id="@+id/player_view_item_post_detail_video_autoplay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:show_timeout="1000"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView <pl.droidsonroids.gif.GifImageView

View File

@ -206,6 +206,7 @@
android:id="@+id/player_view_item_post_video_type_autoplay" android:id="@+id/player_view_item_post_video_type_autoplay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:show_timeout="1000"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" /> app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView <pl.droidsonroids.gif.GifImageView