small player fix

This commit is contained in:
LagradOst 2021-05-28 15:43:43 +02:00
parent 35040e793a
commit ffd3a443fa
2 changed files with 9 additions and 13 deletions

View file

@ -433,10 +433,12 @@ class PlayerFragment : Fragment() {
}
val nextEp = percentage >= OPENING_PROCENTAGE
val data = localData
skip_op_text.text = if (nextEp) "Next Episode" else "Skip OP"
val isVis =
if (nextEp) hasNext //&& !isCurrentlySkippingEp
else (localData is AnimeLoadResponse)
else (data is AnimeLoadResponse && (data.type == TvType.Anime || data.type == TvType.ONA))
skip_op.visibility = if (isVis) View.VISIBLE else View.GONE
}
}
@ -1051,7 +1053,7 @@ class PlayerFragment : Fragment() {
video_title_rez?.text =
if (height == null || width == null) currentUrl.name else "${currentUrl.name} - ${width}x${height}"
if(!hasUsedFirstRender) { // DON'T WANT TO SET MULTIPLE MESSAGES
if (!hasUsedFirstRender) { // DON'T WANT TO SET MULTIPLE MESSAGES
println("FIRST RENDER")
changeSkip()
exoPlayer
@ -1074,8 +1076,7 @@ class PlayerFragment : Fragment() {
.send()
}
else {
} else {
changeSkip()
}
hasUsedFirstRender = true

View file

@ -104,8 +104,6 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="250dp"
android:layout_marginStart="250dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:gravity="center"
@ -119,16 +117,13 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="250dp"
android:layout_marginStart="250dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:gravity="center"
android:layout_marginTop="35dp"
android:layout_marginTop="0dp"
android:textColor="@color/white"
android:id="@+id/video_title_rez"
tools:text="1920x1080"
>
app:layout_constraintTop_toBottomOf="@+id/video_title">
</TextView>
<!--
<LinearLayout
@ -619,8 +614,8 @@
card_view:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:id="@+id/skip_op"
android:visibility="gone"
card_view:cardElevation="0dp"
>
<LinearLayout
android:layout_width="wrap_content"