Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] - Menu Key open app list #472

Open
HeCodes2Much opened this issue May 1, 2024 · 3 comments
Open

[Feature Request] - Menu Key open app list #472

HeCodes2Much opened this issue May 1, 2024 · 3 comments

Comments

@HeCodes2Much
Copy link

Something like this added to the MainActivity. maybe you could do a better way who knows but just an option for feature phone users.

override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
      return when (keyCode) {
          KeyEvent.KEYCODE_MENU -> {
              when (navController.currentDestination?.id) {
                  R.id.mainFragment -> {
                      Navigation.findNavController(this, R.id.nav_host_fragment)
                          .navigate(R.id.action_mainFragment_to_appListFragment)
                      true
                  }

                  else -> {
                      false
                  }
              }
          }
          else -> {
              super.onKeyDown(keyCode, event)
          }
      }
  }
@tanujnotes
Copy link
Owner

Have you tested this on a feature phone?

@HeCodes2Much
Copy link
Author

HeCodes2Much commented May 1, 2024 via email

@tanujnotes
Copy link
Owner

Thanks. I'll check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants