Automatically focus grid within EnhancedBrowseFragment

This commit is contained in:
Niels van Velzen authored and Niels van Velzen committed 2026-10-12 21:54:15 +02:00
1 parent 4f97f16338
commit 22fbde87e8
2 files changed
+14 -1

No files matched your search

@@ -0,0 +1,13 @@
package org.jellyfin.androidtv.ui.browsing
import android.os.Bundle
import android.view.View
import androidx.leanback.app.RowsSupportFragment
open class AutoFocusRowsFragment : RowsSupportFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
verticalGridView.requestFocus()
}
}
@@ -128,7 +128,7 @@ public class EnhancedBrowseFragment extends Fragment implements RowLoader, View.
// Inject the RowsSupportFragment in the results container
if (getChildFragmentManager().findFragmentById(R.id.rowsFragment) == null) {
mRowsFragment = new RowsSupportFragment();
mRowsFragment = new AutoFocusRowsFragment();
getChildFragmentManager()
.beginTransaction()
.replace(R.id.rowsFragment, mRowsFragment).commit();