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()) activity?.navigate(id, Bundle())
} }
settings_player?.setOnClickListener { val isTrueTv = context?.isTrueTvSettings() == true
navigate(R.id.action_navigation_settings_to_navigation_settings_player)
}
settings_credits?.setOnClickListener { listOf(
navigate(R.id.action_navigation_settings_to_navigation_settings_account) 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),
settings_ui?.setOnClickListener { Pair(settings_lang, R.id.action_navigation_settings_to_navigation_settings_lang),
navigate(R.id.action_navigation_settings_to_navigation_settings_ui) 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) ->
settings_lang?.setOnClickListener { view?.apply {
navigate(R.id.action_navigation_settings_to_navigation_settings_lang) setOnClickListener {
} navigate(navigationId)
}
settings_nginx?.setOnClickListener { if (isTrueTv) {
navigate(R.id.action_navigation_settings_to_navigation_settings_nginx) isFocusable = true
} isFocusableInTouchMode = true
}
settings_updates?.setOnClickListener { }
navigate(R.id.action_navigation_settings_to_navigation_settings_updates)
} }
} }
} }