Made player_video_title_rez disappear if blank

This commit is contained in:
Blatzar 2023-01-28 19:39:12 +01:00
parent b2389bf14c
commit 83d2e692e0
3 changed files with 32 additions and 27 deletions

View file

@ -605,7 +605,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
player_top_holder?.isGone = isGone player_top_holder?.isGone = isGone
//player_episodes_button?.isVisible = !isGone && hasEpisodes //player_episodes_button?.isVisible = !isGone && hasEpisodes
player_video_title?.isGone = togglePlayerTitleGone player_video_title?.isGone = togglePlayerTitleGone
player_video_title_rez?.isGone = isGone // player_video_title_rez?.isGone = isGone
player_episode_filler?.isGone = isGone player_episode_filler?.isGone = isGone
player_center_menu?.isGone = isGone player_center_menu?.isGone = isGone
player_lock?.isGone = !isShowing player_lock?.isGone = !isShowing

View file

@ -1149,13 +1149,15 @@ class GeneratorPlayer : FullScreenPlayer() {
val source = currentSelectedLink?.first?.name ?: currentSelectedLink?.second?.name ?: "NULL" val source = currentSelectedLink?.first?.name ?: currentSelectedLink?.second?.name ?: "NULL"
player_video_title_rez?.text = when (titleRez) { val title = when (titleRez) {
0 -> "" 0 -> ""
1 -> extra 1 -> extra
2 -> source 2 -> source
3 -> "$source - $extra" 3 -> "$source - $extra"
else -> "" else -> ""
} }
player_video_title_rez?.text = title
player_video_title_rez?.isVisible = title.isNotBlank()
} }
override fun playerDimensionsLoaded(widthHeight: Pair<Int, Int>) { override fun playerDimensionsLoaded(widthHeight: Pair<Int, Int>) {

View file

@ -96,34 +96,37 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <LinearLayout
android:id="@+id/player_video_title" android:clipToPadding="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="80dp" android:layout_marginStart="80dp"
android:layout_marginTop="35dp" android:paddingTop="20dp"
android:layout_marginEnd="80dp" android:layout_marginEnd="80dp"
android:gravity="center" android:orientation="vertical"
android:textColor="@color/white"
android:textStyle="bold"
android:visibility="visible"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent">
tools:text="Hello world" />
<TextView <TextView
android:id="@+id/player_video_title_rez" android:id="@+id/player_video_title_rez"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="80dp" android:layout_marginBottom="2.5dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="80dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/player_video_title"
tools:text="1920x1080" /> tools:text="1920x1080" />
<TextView
android:id="@+id/player_video_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/white"
android:textStyle="bold"
android:visibility="visible"
tools:text="Hello world" />
</LinearLayout>
<!-- Removed as it has no use anymore--> <!-- Removed as it has no use anymore-->
<!--<androidx.mediarouter.app.MediaRouteButton <!--<androidx.mediarouter.app.MediaRouteButton
@ -319,23 +322,23 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
tools:visibility="visible"
android:id="@+id/skip_chapter_button" android:id="@+id/skip_chapter_button"
style="@style/NiceButton" style="@style/NiceButton"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginEnd="100dp" android:layout_marginEnd="100dp"
android:visibility="gone"
android:maxLines="1"
android:backgroundTint="@color/skipOpTransparent" android:backgroundTint="@color/skipOpTransparent"
android:maxLines="1"
android:padding="10dp" android:padding="10dp"
android:textColor="@color/white" android:textColor="@color/white"
android:visibility="gone"
app:cornerRadius="@dimen/rounded_button_radius" app:cornerRadius="@dimen/rounded_button_radius"
app:layout_constraintBottom_toTopOf="@+id/bottom_player_bar" app:layout_constraintBottom_toTopOf="@+id/bottom_player_bar"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:strokeColor="@color/white" app:strokeColor="@color/white"
app:strokeWidth="1dp" app:strokeWidth="1dp"
tools:text="Skip Opening" /> tools:text="Skip Opening"
tools:visibility="visible" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"