Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,24 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
attachBackPressedCallback("MainActivity") {
showConfirmExitDialog(settingsManager)
}
// Re-point nav rail focus at the provider button on every arrival
// (rail button, back stack pop, first load), so D-pad right always
// reaches the "None" / provider selector button.
if (isLayout(TV or EMULATOR)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request works and it really is an important bug fix, but right now it breaks D-pad behavior when pressing right on a populated home screen. It always changes focus to home_change_api even if home_change_api is not visible on the screen when scrolled down.

I am not sure how to best solve this issue. I can not trade one bug for another. Please see if you can resolve this new bug.

val fromView = binding?.navRailView
if (fromView != null) {
fromView.nextFocusRightId = R.id.home_change_api
for (focusView in arrayOf(
R.id.navigation_downloads,
R.id.navigation_home,
R.id.navigation_search,
R.id.navigation_library,
R.id.navigation_settings,
)) {
fromView.findViewById<View?>(focusView)?.nextFocusRightId = R.id.home_change_api
}
}
}
} else detachBackPressedCallback("MainActivity")
}

Expand Down