Fix keyboard navigation work in Settings home page

Bug: 156196960
Bug: 156565546
Test: manually confirmed tab or arrow key moves input focus.
Change-Id: Ic2eb6395b490c97c8d82722ce1ba3a79d535ade2
This commit is contained in:
Hiroki Sato
2020-06-02 16:08:34 +09:00
parent 82b99f14a2
commit 8870dcb421
2 changed files with 9 additions and 4 deletions

View File

@@ -90,5 +90,9 @@ public class SettingsHomepageActivity extends FragmentActivity {
// The top padding is the height of action bar(48dp) + top/bottom margins(16dp)
final int paddingTop = searchBarHeight + searchBarMargin * 2;
view.setPadding(0 /* left */, paddingTop, 0 /* right */, 0 /* bottom */);
// Prevent inner RecyclerView gets focus and invokes scrolling.
view.setFocusableInTouchMode(true);
view.requestFocus();
}
}
}