Merge pull request #786 from Bnyro/master

player UI improvements
This commit is contained in:
Bnyro 2022-07-14 22:07:09 +02:00 committed by GitHub
commit 8d6f2d9354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 53 deletions

View File

@ -1303,7 +1303,8 @@ class PlayerFragment : Fragment() {
playerBinding.exoPlayPause.visibility = visibility
playerBinding.exoBottomBar.visibility = visibility
playerBinding.closeImageButton.visibility = visibility
playerBinding.exoTitle.visibility = visibility
playerBinding.exoTitle.visibility =
if (isLocked && Globals.isFullScreen) View.VISIBLE else View.INVISIBLE
// disable double tap to seek when the player is locked
if (isLocked) enableDoubleTapToSeek() else disableDoubleTapToSeek()

View File

@ -1,4 +1,10 @@
<vector android:height="24dp" android:viewportHeight="48"
android:viewportWidth="48" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="m24.1,38 l5.7,-5.65 -5.7,-5.65 -2.1,2.1 2.15,2.15q-1.4,0.05 -2.725,-0.45 -1.325,-0.5 -2.375,-1.55 -1,-1 -1.525,-2.3 -0.525,-1.3 -0.525,-2.6 0,-0.85 0.225,-1.7t0.625,-1.65l-2.2,-2.2q-0.85,1.25 -1.25,2.65T14,24q0,1.9 0.75,3.75t2.2,3.3q1.45,1.45 3.25,2.175 1.8,0.725 3.7,0.775L22,35.9ZM32.35,29.5q0.85,-1.25 1.25,-2.65T34,24q0,-1.9 -0.725,-3.775T31.1,16.9q-1.45,-1.45 -3.275,-2.15t-3.725,-0.7L26,12.1 23.9,10l-5.7,5.65 5.7,5.65 2.1,-2.1 -2.2,-2.2q1.35,0 2.75,0.525t2.4,1.525q1,1 1.525,2.3 0.525,1.3 0.525,2.6 0,0.85 -0.225,1.7t-0.625,1.65ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#FF000000"
android:pathData="m24.1,38 l5.7,-5.65 -5.7,-5.65 -2.1,2.1 2.15,2.15q-1.4,0.05 -2.725,-0.45 -1.325,-0.5 -2.375,-1.55 -1,-1 -1.525,-2.3 -0.525,-1.3 -0.525,-2.6 0,-0.85 0.225,-1.7t0.625,-1.65l-2.2,-2.2q-0.85,1.25 -1.25,2.65T14,24q0,1.9 0.75,3.75t2.2,3.3q1.45,1.45 3.25,2.175 1.8,0.725 3.7,0.775L22,35.9ZM32.35,29.5q0.85,-1.25 1.25,-2.65T34,24q0,-1.9 -0.725,-3.775T31.1,16.9q-1.45,-1.45 -3.275,-2.15t-3.725,-0.7L26,12.1 23.9,10l-5.7,5.65 5.7,5.65 2.1,-2.1 -2.2,-2.2q1.35,0 2.75,0.525t2.4,1.525q1,1 1.525,2.3 0.525,1.3 0.525,2.6 0,0.85 -0.225,1.7t-0.625,1.65ZM24,44q-4.1,0 -7.75,-1.575 -3.65,-1.575 -6.375,-4.3 -2.725,-2.725 -4.3,-6.375Q4,28.1 4,24q0,-4.15 1.575,-7.8 1.575,-3.65 4.3,-6.35 2.725,-2.7 6.375,-4.275Q19.9,4 24,4q4.15,0 7.8,1.575 3.65,1.575 6.35,4.275 2.7,2.7 4.275,6.35Q44,19.85 44,24q0,4.1 -1.575,7.75 -1.575,3.65 -4.275,6.375t-6.35,4.3Q28.15,44 24,44Z" />
</vector>

View File

@ -20,28 +20,21 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layoutDirection="ltr"
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding">
android:layout_marginStart="5dp"
android:layoutDirection="ltr">
<ImageButton
<ImageView
android:id="@+id/close_imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:background="#00FFFFFF"
android:padding="@dimen/exo_icon_padding"
style="@style/PlayerControlTop"
android:src="@drawable/ic_close"
app:tint="@android:color/white" />
<ImageButton
<ImageView
android:id="@+id/lock_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00FFFFFF"
android:padding="@dimen/exo_icon_padding"
style="@style/PlayerControlTop"
android:layout_marginStart="-5dp"
android:scaleX=".9"
android:scaleY=".9"
android:src="@drawable/ic_unlocked" />
</LinearLayout>
@ -64,42 +57,26 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layoutDirection="ltr"
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding">
android:layout_marginEnd="10dp"
android:layoutDirection="ltr">
<ImageButton
<ImageView
android:id="@+id/aspect_ratio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="5dp"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/exo_icon_padding"
style="@style/PlayerControlTop"
android:layout_marginTop="-1dp"
android:scaleX=".9"
android:scaleY=".9"
android:src="@drawable/ic_aspect_ratio" />
<TextView
android:id="@+id/speed_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="5dp"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/exo_icon_padding"
android:text="1x"
android:textColor="#FFFFFF" />
style="@style/PlayerControlTop"
android:text="1x" />
<TextView
android:id="@+id/quality_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="5dp"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/exo_icon_padding"
android:text="@string/hls"
android:textColor="#FFFFFF" />
style="@style/PlayerControlTop"
android:text="@string/hls" />
</LinearLayout>
@ -116,7 +93,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
@ -176,17 +152,17 @@
<ImageButton
android:id="@+id/repeat_toggle"
style="@style/PlayerButton"
style="@style/PlayerControlBottom"
android:src="@drawable/ic_repeat"
app:tint="@android:color/darker_gray" />
<ImageButton
android:id="@id/exo_subtitle"
style="@style/PlayerButton" />
style="@style/PlayerControlBottom" />
<ImageButton
android:id="@+id/fullscreen"
style="@style/PlayerButton"
style="@style/PlayerControlBottom"
android:src="@drawable/ic_fullscreen"
app:tint="@android:color/white" />

View File

@ -104,14 +104,27 @@
</style>
<style name="PlayerButton">
<style name="PlayerControlBottom">
<item name="android:padding">9dp</item>
<item name="android:layout_height">36dp</item>
<item name="android:layout_width">36dp</item>
<item name="android:layout_gravity">center</item>
<item name="android:background">?attr/selectableItemBackground</item>
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
</style>
<style name="PlayerControlTop">
<item name="android:padding">9dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
<item name="android:textColor">@android:color/white</item>
</style>
</resources>