forked from recloudstream/cloudstream
fire tv testing 🙏
This commit is contained in:
parent
48c786a5b8
commit
9ed55d6d82
1 changed files with 15 additions and 0 deletions
|
@ -25,6 +25,7 @@ import com.lagradost.cloudstream3.CommonActivity.onColorSelectedEvent
|
||||||
import com.lagradost.cloudstream3.CommonActivity.onDialogDismissedEvent
|
import com.lagradost.cloudstream3.CommonActivity.onDialogDismissedEvent
|
||||||
import com.lagradost.cloudstream3.CommonActivity.showToast
|
import com.lagradost.cloudstream3.CommonActivity.showToast
|
||||||
import com.lagradost.cloudstream3.R
|
import com.lagradost.cloudstream3.R
|
||||||
|
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
|
||||||
import com.lagradost.cloudstream3.utils.DataStore.setKey
|
import com.lagradost.cloudstream3.utils.DataStore.setKey
|
||||||
import com.lagradost.cloudstream3.utils.Event
|
import com.lagradost.cloudstream3.utils.Event
|
||||||
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
|
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
|
||||||
|
@ -195,7 +196,15 @@ class SubtitlesFragment : Fragment() {
|
||||||
state = getCurrentSavedStyle()
|
state = getCurrentSavedStyle()
|
||||||
context?.updateState()
|
context?.updateState()
|
||||||
|
|
||||||
|
val isTvSettings = context?.isTvSettings() == true
|
||||||
|
|
||||||
|
fun View.setFocusableInTv() {
|
||||||
|
this.isFocusableInTouchMode = isTvSettings
|
||||||
|
}
|
||||||
|
|
||||||
fun View.setup(id: Int) {
|
fun View.setup(id: Int) {
|
||||||
|
setFocusableInTv()
|
||||||
|
|
||||||
this.setOnClickListener {
|
this.setOnClickListener {
|
||||||
activity?.let {
|
activity?.let {
|
||||||
ColorPickerDialog.newBuilder()
|
ColorPickerDialog.newBuilder()
|
||||||
|
@ -223,6 +232,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
activity?.hideSystemUI()
|
activity?.hideSystemUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_subtitle_elevation.setFocusableInTv()
|
||||||
subs_subtitle_elevation.setOnClickListener { textView ->
|
subs_subtitle_elevation.setOnClickListener { textView ->
|
||||||
val suffix = "dp"
|
val suffix = "dp"
|
||||||
val elevationTypes = listOf(
|
val elevationTypes = listOf(
|
||||||
|
@ -261,6 +271,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
return@setOnLongClickListener true
|
return@setOnLongClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_edge_type.setFocusableInTv()
|
||||||
subs_edge_type.setOnClickListener { textView ->
|
subs_edge_type.setOnClickListener { textView ->
|
||||||
val edgeTypes = listOf(
|
val edgeTypes = listOf(
|
||||||
Pair(
|
Pair(
|
||||||
|
@ -305,6 +316,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
return@setOnLongClickListener true
|
return@setOnLongClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_font_size.setFocusableInTv()
|
||||||
subs_font_size.setOnClickListener { textView ->
|
subs_font_size.setOnClickListener { textView ->
|
||||||
val suffix = "sp"
|
val suffix = "sp"
|
||||||
val fontSizes = listOf(
|
val fontSizes = listOf(
|
||||||
|
@ -356,6 +368,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
return@setOnLongClickListener true
|
return@setOnLongClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_font.setFocusableInTv()
|
||||||
subs_font.setOnClickListener { textView ->
|
subs_font.setOnClickListener { textView ->
|
||||||
val fontTypes = listOf(
|
val fontTypes = listOf(
|
||||||
Pair(null, textView.context.getString(R.string.normal)),
|
Pair(null, textView.context.getString(R.string.normal)),
|
||||||
|
@ -395,6 +408,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
return@setOnLongClickListener true
|
return@setOnLongClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_auto_select_language.setFocusableInTv()
|
||||||
subs_auto_select_language.setOnClickListener { textView ->
|
subs_auto_select_language.setOnClickListener { textView ->
|
||||||
val langMap = arrayListOf(
|
val langMap = arrayListOf(
|
||||||
SubtitleHelper.Language639(
|
SubtitleHelper.Language639(
|
||||||
|
@ -427,6 +441,7 @@ class SubtitlesFragment : Fragment() {
|
||||||
return@setOnLongClickListener true
|
return@setOnLongClickListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subs_download_languages.setFocusableInTv()
|
||||||
subs_download_languages.setOnClickListener { textView ->
|
subs_download_languages.setOnClickListener { textView ->
|
||||||
val langMap = SubtitleHelper.languages
|
val langMap = SubtitleHelper.languages
|
||||||
val lang639_1 = langMap.map { it.ISO_639_1 }
|
val lang639_1 = langMap.map { it.ISO_639_1 }
|
||||||
|
|
Loading…
Reference in a new issue