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_episodes_button?.isVisible = !isGone && hasEpisodes
player_video_title?.isGone = togglePlayerTitleGone
player_video_title_rez?.isGone = isGone
// player_video_title_rez?.isGone = isGone
player_episode_filler?.isGone = isGone
player_center_menu?.isGone = isGone
player_lock?.isGone = !isShowing

View File

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

View File

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