mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
adding icon button to show current
This commit is contained in:
parent
281b18e609
commit
e0a3cb5f0a
3 changed files with 103 additions and 71 deletions
|
@ -564,6 +564,10 @@ open class ResultFragmentPhone : FullScreenPlayer() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
showCurrentButton.isVisible = !resume.isMovie;
|
||||||
|
showCurrentButton.setOnClickListener {
|
||||||
|
viewModel.restoreSeasonAndRange()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2472,25 +2472,25 @@ class ResultViewModel2 : ViewModel() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreSeasonAndRange(resume)
|
|
||||||
|
|
||||||
return ResumeWatchingStatus(progress = progress, isMovie = isMovie, result = episode)
|
return ResumeWatchingStatus(progress = progress, isMovie = isMovie, result = episode)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun restoreSeasonAndRange(resume: VideoDownloadHelper.ResumeWatching) {
|
fun restoreSeasonAndRange() {
|
||||||
|
val correctId = currentId ?: return
|
||||||
|
val resume = getLastWatched(correctId)
|
||||||
// restore season based on resume details
|
// restore season based on resume details
|
||||||
resume.season?.apply {
|
resume?.season?.apply {
|
||||||
changeSeason(this)
|
changeSeason(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore dubStatus based on resume details
|
// restore dubStatus based on resume details
|
||||||
resume.dubStatus?.apply {
|
resume?.dubStatus?.apply {
|
||||||
changeDubStatus(this)
|
changeDubStatus(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore range based on resume details
|
// restore range based on resume details
|
||||||
currentRanges[currentIndex]?.first {
|
currentRanges[currentIndex]?.first {
|
||||||
it.endEpisode >= resume.episode ?: 0
|
it.endEpisode >= resume?.episode ?: 0
|
||||||
}?.apply {
|
}?.apply {
|
||||||
changeRange(this)
|
changeRange(this)
|
||||||
}
|
}
|
||||||
|
|
|
@ -733,76 +733,104 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:fadingEdge="horizontal"
|
||||||
android:gravity="center_vertical"
|
android:requiresFadingEdge="horizontal">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<LinearLayout
|
||||||
android:id="@+id/result_season_button"
|
|
||||||
style="@style/MultiSelectButton"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
|
||||||
android:nextFocusLeft="@id/result_episode_select"
|
|
||||||
android:nextFocusRight="@id/result_episode_select"
|
|
||||||
android:nextFocusUp="@id/result_description"
|
|
||||||
android:nextFocusDown="@id/result_episodes"
|
|
||||||
android:paddingStart="10dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="Season 1"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/result_episode_select"
|
|
||||||
style="@style/MultiSelectButton"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
|
||||||
android:nextFocusLeft="@id/result_season_button"
|
|
||||||
android:nextFocusRight="@id/result_season_button"
|
|
||||||
android:nextFocusUp="@id/result_description"
|
|
||||||
android:nextFocusDown="@id/result_episodes"
|
|
||||||
android:paddingStart="10dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="50-100"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/result_dub_select"
|
|
||||||
style="@style/MultiSelectButton"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
|
||||||
android:nextFocusLeft="@id/result_season_button"
|
|
||||||
android:nextFocusRight="@id/result_season_button"
|
|
||||||
android:nextFocusUp="@id/result_description"
|
|
||||||
android:nextFocusDown="@id/result_episodes"
|
|
||||||
android:paddingStart="10dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="Dubbed"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/result_episodes_text"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_marginBottom="10dp"
|
||||||
android:paddingTop="10dp"
|
android:gravity="center_vertical"
|
||||||
android:paddingBottom="10dp"
|
android:orientation="horizontal">
|
||||||
android:textColor="?attr/textColor"
|
<ImageView
|
||||||
android:textSize="17sp"
|
android:id="@+id/show_current_button"
|
||||||
android:textStyle="normal"
|
android:layout_width="wrap_content"
|
||||||
tools:text="8 Episodes" />
|
android:layout_height="match_parent"
|
||||||
</LinearLayout>
|
android:background="@drawable/outline_drawable_less"
|
||||||
|
android:focusable="true"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:src="@drawable/ic_outline_remove_red_eye_24"
|
||||||
|
app:tint="?attr/white"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
||||||
|
android:nextFocusLeft="@id/show_current_button"
|
||||||
|
android:nextFocusRight="@id/result_season_button"
|
||||||
|
android:nextFocusUp="@id/result_description"
|
||||||
|
android:nextFocusDown="@id/result_episodes"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/result_season_button"
|
||||||
|
style="@style/MultiSelectButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
||||||
|
android:nextFocusLeft="@id/show_current_button"
|
||||||
|
android:nextFocusRight="@id/result_episode_select"
|
||||||
|
android:nextFocusUp="@id/result_description"
|
||||||
|
android:nextFocusDown="@id/result_episodes"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Season 1"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/result_episode_select"
|
||||||
|
style="@style/MultiSelectButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
||||||
|
android:nextFocusLeft="@id/result_season_button"
|
||||||
|
android:nextFocusRight="@id/result_season_button"
|
||||||
|
android:nextFocusUp="@id/result_description"
|
||||||
|
android:nextFocusDown="@id/result_episodes"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="50-100"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/result_dub_select"
|
||||||
|
style="@style/MultiSelectButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableEnd="@drawable/ic_baseline_keyboard_arrow_down_24"
|
||||||
|
android:nextFocusLeft="@id/result_season_button"
|
||||||
|
android:nextFocusRight="@id/result_season_button"
|
||||||
|
android:nextFocusUp="@id/result_description"
|
||||||
|
android:nextFocusDown="@id/result_episodes"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="Dubbed"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/result_episodes_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:textColor="?attr/textColor"
|
||||||
|
android:textSize="17sp"
|
||||||
|
android:textStyle="normal"
|
||||||
|
tools:text="8 Episodes" />
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
|
||||||
<!--TODO add next airing-->
|
<!--TODO add next airing-->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue