Skip to content

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

@CreativeCodeCat

Description

@CreativeCodeCat

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)
          }
      }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions