fix fullscreen chapter layout

This commit is contained in:
Bnyro 2022-07-09 22:30:02 +02:00
parent d134677fc8
commit 782076ebb4
2 changed files with 34 additions and 38 deletions

View File

@ -350,7 +350,6 @@ class PlayerFragment : Fragment() {
"ratio" -> {
val videoSize = exoPlayer.videoSize
// probably a youtube shorts video
Log.e(TAG, videoSize.height.toString() + " " + videoSize.width.toString())
if (videoSize.height > videoSize.width) ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
// a video with normal aspect ratio
else ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
@ -989,7 +988,6 @@ class PlayerFragment : Fragment() {
// check whether the chapter start is greater than the current player position
if (it.start!! * 1000 >= currentPosition) chapterName = it.title
}
Log.e(TAG, chapterName.toString())
// change the chapter name textView text to the chapterName
if (chapterName != null && chapterName != playerBinding.chapterName.text) {
playerBinding.chapterName.text = chapterName

View File

@ -106,20 +106,18 @@
</LinearLayout>
<FrameLayout
<LinearLayout
android:id="@id/exo_bottom_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/exo_styled_bottom_bar_height"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="@dimen/exo_styled_bottom_bar_margin_top"
android:layoutDirection="ltr">
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:layout_marginBottom="10dp"
android:layoutDirection="ltr"
android:layout_marginBottom="-10dp"
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"
@ -128,7 +126,9 @@
<LinearLayout
android:id="@id/exo_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp">
<TextView
android:id="@id/exo_position"
@ -144,10 +144,12 @@
<LinearLayout
android:id="@+id/chapterLL"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:visibility="gone" >
android:layout_gravity="center"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:visibility="invisible">
<TextView
android:id="@+id/chapter_name"
@ -156,8 +158,7 @@
android:layout_gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="14sp" />
android:textColor="@android:color/white" />
<ImageView
android:layout_width="15dp"
@ -169,33 +170,30 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@id/exo_basic_controls"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="@id/exo_basic_controls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginBottom="10dp"
android:layoutDirection="ltr">
<ImageButton
android:id="@id/exo_repeat_toggle"
style="@style/ExoStyledControls.Button.Bottom.RepeatToggle" />
<ImageButton
android:id="@id/exo_repeat_toggle"
style="@style/ExoStyledControls.Button.Bottom.RepeatToggle" />
<ImageButton
android:id="@id/exo_subtitle"
style="@style/ExoStyledControls.Button.Bottom.CC" />
<ImageButton
android:id="@id/exo_subtitle"
style="@style/ExoStyledControls.Button.Bottom.CC" />
<ImageButton
android:id="@id/exo_settings"
style="@style/ExoStyledControls.Button.Bottom.Settings" />
<ImageButton
android:id="@id/exo_settings"
style="@style/ExoStyledControls.Button.Bottom.Settings" />
<ImageButton
android:id="@+id/fullscreen"
style="@style/ExoStyledControls.Button.Bottom.FullScreen"
android:src="@drawable/ic_fullscreen"
app:tint="@android:color/white" />
<ImageButton
android:id="@+id/fullscreen"
style="@style/ExoStyledControls.Button.Bottom.FullScreen"
android:src="@drawable/ic_fullscreen"
app:tint="@android:color/white" />
</LinearLayout>
</LinearLayout>
@ -220,7 +218,7 @@
</LinearLayout>
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@id/exo_center_controls"