Skip to content

Commit

Permalink
Fix rotary wheel scrolling for activities
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Oct 26, 2024
1 parent 993eb9a commit 8c90fad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class ShortcutPicker : PreferenceFragment() {
preferenceScreen.setTitle(R.string.preference_screen_title_shortcut_picker)
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
// Enable rotary wheel scrolling.
view?.requestFocus()
}

override fun onPreferenceTreeClick(
preferenceScreen: PreferenceScreen?,
preference: Preference?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ class AuthenticatorMainMenu : PreferenceFragment(), CoroutineScope, Logging {
addPreferencesFromResource(R.xml.preferences_authenticator)
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
// Enable rotary wheel scrolling.
view?.requestFocus()
}

override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
bluetoothSettingsPreference =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class ResidentCredentialsPreferenceFragment : PreferenceFragment() {
createCredentialList()
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
// Enable rotary wheel scrolling.
view?.requestFocus()
}

private fun createCredentialList() {
preferenceScreen = preferenceManager.createPreferenceScreen(context)
val credentialsPerRp = AuthenticatorContext.getAllResidentCredentials(context)
Expand Down
2 changes: 2 additions & 0 deletions authenticator/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
android:fillViewport="true"
tools:context="me.henneke.wearauthn.ui.main.AboutActivity">

<requestFocus />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 2 additions & 0 deletions authenticator/src/main/res/layout/dialog_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
android:overScrollMode="never"
android:scrollbars="none">

<requestFocus />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 8c90fad

Please sign in to comment.