forked from recloudstream/cloudstream
tv ui fix
This commit is contained in:
parent
db3e23621a
commit
cb11cd13e6
6 changed files with 619 additions and 591 deletions
|
@ -29,11 +29,10 @@ class WebviewFragment : Fragment() {
|
|||
request: WebResourceRequest?
|
||||
): Boolean {
|
||||
val requestUrl = request?.url.toString()
|
||||
|
||||
val repoUrl = if (requestUrl.startsWith("https://cs.repo")) {
|
||||
"https://" + requestUrl.substringAfter("?")
|
||||
} else if (URI(requestUrl).scheme == appStringRepo) {
|
||||
"https://" + requestUrl.replaceFirst(appStringRepo, "https")
|
||||
requestUrl.replaceFirst(appStringRepo, "https")
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
|
|
@ -287,19 +287,19 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
2 -> {
|
||||
result_bookmark_fab?.isGone = result_bookmark_fab?.context?.isTvSettings() == true
|
||||
result_bookmark_fab?.extend()
|
||||
if (result_bookmark_button?.context?.isTrueTvSettings() == true) {
|
||||
when {
|
||||
result_play_movie?.isVisible == true -> {
|
||||
result_play_movie?.requestFocus()
|
||||
}
|
||||
result_resume_series_button?.isVisible == true -> {
|
||||
result_resume_series_button?.requestFocus()
|
||||
}
|
||||
else -> {
|
||||
result_bookmark_button?.requestFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (result_bookmark_button?.context?.isTrueTvSettings() == true) {
|
||||
// when {
|
||||
// result_play_movie?.isVisible == true -> {
|
||||
// result_play_movie?.requestFocus()
|
||||
// }
|
||||
// result_resume_series_button?.isVisible == true -> {
|
||||
// result_resume_series_button?.requestFocus()
|
||||
// }
|
||||
// else -> {
|
||||
// result_bookmark_button?.requestFocus()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
result_loading?.isVisible = false
|
||||
result_finish_loading?.isVisible = true
|
||||
|
@ -498,6 +498,17 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
viewModel.updateWatchStatus(WatchType.values()[it])
|
||||
}
|
||||
}
|
||||
|
||||
result_bookmark_button?.setOnClickListener { fab ->
|
||||
activity?.showBottomDialog(
|
||||
WatchType.values().map { fab.context.getString(it.stringRes) }.toList(),
|
||||
watchType.ordinal,
|
||||
fab.context.getString(R.string.action_add_to_bookmarks),
|
||||
showApply = false,
|
||||
{}) {
|
||||
viewModel.updateWatchStatus(WatchType.values()[it])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is to band-aid FireTV navigation
|
||||
|
@ -859,7 +870,7 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
.contains(DubStatus.Dubbed)
|
||||
) DubStatus.Dubbed else DubStatus.Subbed
|
||||
|
||||
result_bookmark_button?.isVisible = ctx.isTvSettings()
|
||||
//result_bookmark_button?.isVisible = ctx.isTvSettings()
|
||||
|
||||
val settingsManager = PreferenceManager.getDefaultSharedPreferences(ctx)
|
||||
val showFillers =
|
||||
|
|
|
@ -159,6 +159,7 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
activity?.popCurrentPage()
|
||||
}
|
||||
|
||||
/*
|
||||
result_bookmark_button?.setOnClickListener {
|
||||
it.popupMenuNoIcons(
|
||||
items = WatchType.values()
|
||||
|
@ -167,7 +168,7 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
) {
|
||||
viewModel.updateWatchStatus(WatchType.fromInternalId(this.itemId))
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
result_mini_sync?.adapter = ImageAdapter(
|
||||
R.layout.result_mini_image,
|
||||
|
@ -300,8 +301,8 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
if (result_season_button?.isVisible == true)
|
||||
if (result_resume_parent?.isVisible == true)
|
||||
setFocusUpAndDown(result_resume_series_button, result_season_button)
|
||||
else
|
||||
setFocusUpAndDown(result_bookmark_button, result_season_button)
|
||||
//else
|
||||
// setFocusUpAndDown(result_bookmark_button, result_season_button)
|
||||
}
|
||||
|
||||
observe(viewModel.selectedDubStatus) { status ->
|
||||
|
@ -311,8 +312,8 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
if (result_season_button?.isVisible != true && result_episode_select?.isVisible != true) {
|
||||
if (result_resume_parent?.isVisible == true)
|
||||
setFocusUpAndDown(result_resume_series_button, result_dub_select)
|
||||
else
|
||||
setFocusUpAndDown(result_bookmark_button, result_dub_select)
|
||||
//else
|
||||
// setFocusUpAndDown(result_bookmark_button, result_dub_select)
|
||||
}
|
||||
}
|
||||
observe(viewModel.selectedRange) { range ->
|
||||
|
@ -323,8 +324,8 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
if (result_season_button?.isVisible != true) {
|
||||
if (result_resume_parent?.isVisible == true)
|
||||
setFocusUpAndDown(result_resume_series_button, result_episode_select)
|
||||
else
|
||||
setFocusUpAndDown(result_bookmark_button, result_episode_select)
|
||||
//else
|
||||
// setFocusUpAndDown(result_bookmark_button, result_episode_select)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!--
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/result_bookmark_button"
|
||||
style="@style/BlackButton"
|
||||
|
@ -417,7 +417,7 @@
|
|||
app:icon="@drawable/ic_baseline_bookmark_24"
|
||||
tools:text="Bookmark"
|
||||
tools:visibility="visible" />
|
||||
|
||||
-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_cast_text"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:nextFocusDown="@id/result_bookmark_button"
|
||||
android:nextFocusRight="@id/result_share"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
|
||||
|
@ -128,7 +127,6 @@
|
|||
android:nextFocusUp="@id/result_back"
|
||||
android:nextFocusDown="@id/result_description"
|
||||
android:nextFocusLeft="@id/result_search"
|
||||
android:nextFocusRight="@id/result_bookmark_button"
|
||||
|
||||
android:id="@+id/result_recommendations_btt"
|
||||
android:layout_width="25dp"
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue