refactor: convert from Android TV to phone/tablet mode
- Replace Theme.Leanback with Theme.AppCompat.DayNight.NoActionBar - Remove leanback dependencies (leanback, leanback-preference) - Remove LEANBACK_LAUNCHER, leanback feature, banner from manifest - PlayerActivity: replace D-pad with touch controls (click to toggle episodes, close button) - SearchFragment: adaptive grid (3 cols phone / 5 cols tablet), remove focus-based history toggle - Fix deprecated adapterPosition -> bindingAdapterPosition
This commit is contained in:
@@ -77,7 +77,8 @@ class SearchFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun setupResultsGrid() {
|
||||
resultsGrid.layoutManager = GridLayoutManager(context, 4)
|
||||
val spanCount = if (resources.configuration.screenWidthDp >= 600) 5 else 3
|
||||
resultsGrid.layoutManager = GridLayoutManager(context, spanCount)
|
||||
resultsGrid.adapter = adapter
|
||||
}
|
||||
|
||||
@@ -107,12 +108,6 @@ class SearchFragment : Fragment() {
|
||||
showHistory(emptyList())
|
||||
}
|
||||
}
|
||||
|
||||
searchInput.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (hasFocus) {
|
||||
historyContainer.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun performSearch(keyword: String) {
|
||||
|
||||
Reference in New Issue
Block a user