I have a case where i need to use soft navigation keys instead of Hardware navigation keys on a switch button.
I am using system property
Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED
w.r.to this i want to disable/enable soft navigation keys for complete Android System.
Just like in Oneplus Phone, i need to provide switch button to enable and disable soft navigation bar.
Does anyone help how to achieve this.
Related
I am developing a single-use device with Android. HW has a full keyboard but no main keys (Back, Home, Overview).
Some of the app should be working in immersive mode and they contain EditText fields.
When the app is in immersive mode (I used Lock Task Mode), if I select EditText field, a black bar with the same size of the navigation bar, pops up from the bottom.
I cannot set qemu.hw.mainkeys=1 because it removes nav bar completely but I need it for some other apps.
Is there any way I can hide it for EditText in just some cases?
I have access to a full AOSP source.
You can't, Android does not allow you to focus an EditText without showing the Navigation Bar. (except if you are using an external keyboard)
Probably because some people don't know how to unfocus it and need to press the back button.
I use android in kiosk mode so I don't have return key when keyboard setting activity is top!
i want remove or disable keyboard setting button from on screen keyboard.
We cann't disable action button on the android keyboard. You will have to settle with chcking for empty string in editor action listener.
Please follow this
Disable one key on custom keyboard in Android
On a phone without hardware buttons, the soft keys bar looks like:
In some app (e.g. the browser), the soft keys bar is minimized and more screen space is available:
How can this be done?
Set your theme to be fullscreen, then build the controls yourself. The Up/Down arrow toggles the fullscreen mode.
I don't think it's a good idea to try to hide that bar, even if this could be done on some devices. It's obvious on most devices these keys are more like hardward key even accept touch input.
how do I disable the menu, home, back and search key programmatically in android, including the vibrate when those keys are pressed.
You can't disable the home button. The back button you'll need to override onBackPressed(), and the menu button shouldn't do anything unless you assign it an action.
If you mean disable these system-wide, I'm afraid glad you can't do that.
I would like to remove the navigation buttons at the bottom of the soft keyboard ( the buttons with the arrow- they act like a tab key to move between fields). I have had no luck trying to find a way to do this. Does anyone have any suggestions
What you're describing is device-specific, as each device has its own default soft keyboard. Unfortunately, you'll need to make a custom keyboard.
Look at the Keyboard class.
I don't believe it's possible to remove the button from the keyboard, but you can at least specify which neighbor the field gives focus to. See Handling UI Events on the Android Dev Guide.
Perhaps it's possible to set nextFocusDown to nothing, so the keyboard doesn't let the user navigate in that fashion. If that doesn't work, you might consider setting the field that takes focus next to setFocusable(false).