How to hide navigation bar when edittext is focused in immersive mode - android

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.

Related

Android: Low profile mode with a keyboard

I have an app that uses LOW_PROFILE_MODE to hide soft buttons.
It works quite ok, but when I select a TextView and the software keyboard appears on the screen, the LOW_PROFILE_MODE is gone.
Is there a way to use android soft keyboard and stay in LOW_PROFILE_MODE on Android 5+?

Keyboard hides soft buttons (back, home, recent buttons)

I've written a sidebar app that is always available and draws directly to the window. If the user has a phone without hardware buttons and he starts typing into an EditText the button bar (that is part of the display because of the missing hardware buttons) with the back/home/recent buttons is hidden.
How can I prevent that?

How to change the soft keys bar into a minimized version?

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 create fullscreen in android 4.0?

Hello,
I need do fullscreen in android 4.0 (I must hide back button, home...)
I used android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
but it doesn't work.
Homebutton and backbutton cannot be hidden...
Users always need to have access to these buttons, so the black bar will always be on the screen
Like write K_Anas in a relative question, it is not possible hide Homebutton and backbutton in Android 4.0, for security reasons and because is a simply anti-pattern solution.
You can use SYSTEM_UI_FLAG_HIDE_NAVIGATION to hide the system navigation temporarily, but it will always reappear when the user touches the screen. Even the notification bar will reappear when the screen is touched.
You are not allowed to hide the system bar with the home button completely for security reasons.

Android 4 overlay/replace/hide soft buttons

I'm currently working on an app for blind people. What I need is to prevent users from accidentally going outside of my app, so I'm trying to overlay/replace/hide soft buttons in Android 4. I know this must be possible because it is used for example in MXPlayer (you can "lock" screen when playing video).
I've tried to override all three buttons (back,home,recent apps). No problem with back and home, but I couldn't figure out how to override(disable) recent apps. I've tried solution described here without success.
Next idea was to overlay the entire screen. I've successfully created system overlay mentioned in this question, but I didn't find out how to overlay my soft buttons.
Do you have any idea how to solve this problem without rooting the phone and using custom ROM?
edit: I've also tried hiding the buttons with SYSTEM_UI_FLAG_LOW_PROFILE(turns buttons into dots) and SYSTEM_UI_FLAG_HIDE_NAVIGATION(hides buttons till next touch). Unfortunately this also doesn't solve my problem because after touch buttons work as usual. Maybe there's a way how to catch "unhiding" a override showing them again?
From Android docs :
The SYSTEM_UI_FLAG_LOW_PROFILE flag replaces the STATUS_BAR_HIDDEN flag. When set, this flag enables “low profile" mode for the system bar or navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling this is useful for creating more immersive games without distraction for the system navigation buttons.
The SYSTEM_UI_FLAG_VISIBLE flag replaces the STATUS_BAR_VISIBLE flag to request the system bar or navigation bar be visible.
The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). The navigation bar returns to view as soon as the system receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required.

Categories

Resources