settings selectable in tv mode

This commit is contained in:
LagradOst 2022-05-27 18:39:00 +02:00
parent 276cb78669
commit 57128dbc7d

View file

@ -94,28 +94,25 @@ class SettingsFragment : Fragment() {
activity?.navigate(id, Bundle())
}
settings_player?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_player)
}
val isTrueTv = context?.isTrueTvSettings() == true
settings_credits?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_account)
listOf(
Pair(settings_player, R.id.action_navigation_settings_to_navigation_settings_player),
Pair(settings_credits, R.id.action_navigation_settings_to_navigation_settings_account),
Pair(settings_ui, R.id.action_navigation_settings_to_navigation_settings_ui),
Pair(settings_lang, R.id.action_navigation_settings_to_navigation_settings_lang),
Pair(settings_nginx, R.id.action_navigation_settings_to_navigation_settings_nginx),
Pair(settings_updates, R.id.action_navigation_settings_to_navigation_settings_updates),
).forEach { (view, navigationId) ->
view?.apply {
setOnClickListener {
navigate(navigationId)
}
settings_ui?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_ui)
if (isTrueTv) {
isFocusable = true
isFocusableInTouchMode = true
}
settings_lang?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_lang)
}
settings_nginx?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_nginx)
}
settings_updates?.setOnClickListener {
navigate(R.id.action_navigation_settings_to_navigation_settings_updates)
}
}
}