How to change the soft keys bar into a minimized version? - 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.

Related

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

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.

How to adapt layouts to soft keyboard?

I have an Android app where layout elements size and margins are defined in dimens files (e.g, values-hdpi/dimens.xml, value-xhdpi/dimens.xml, etc.). That worked fine on a few devices, however on the first device with soft keyboard (htc), my elements are not aligned as it should be (keyboard is moved up and overlap some elements). I should note that I'm using my custom keyboard. How can I overcome this ?
There is no automated way to adjust for the soft keyboard. In fact there is no automated way to even know that the keyboard is up or not. The only response you have to it is the soft input mode, which can either resize your app above the keyboard or pan your app to be above your keyboard.

Android keyboard slide animation

I have little (read: no) experience with animations in Android, but wanted to implement an animation for when the keyboard appears. Effectively, it would appear that the entire activity was sliding upwards (like the keyboard was below the activity and pushed it upwards), as opposed to only moving up so far as the selected EditText.
Does anyone know how to do this?
In the latest version of Android OS (Android version 11), they added new set of APIs let you synchronize your app’s content with the IME (input method editor, aka soft keyboard) and system bars as they animate on and offscreen, making it much easier to create natural, intuitive and jank-free IME transitions.
WindowInsetsAnimation.Callback
For frame-perfect transitions, a new insets animation listener notifies apps of per-frame changes to insets while the system bars or the IME animate.
WindowInsetsAnimationController
Apps can take control of the IME and system bar transitions through the WindowInsetsAnimationController API.
An app receives no notification of when a keyboard appears, and the android framework itself is responsible for either sliding the app or laying it out again. So customization isn't really possible. Which is probably a good thing- a keyboard is a separate app, and having written one I wouldn't want to even try to write the keyboard half of such an animation, we'd never get it to look right with all the various ways the app could do it.
The closest you'll get is to specify the fields to pan rather than resize when the keyboard is opened.

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