Stopping the Android Soft Keyboard flashing black switching activities - android

I'm working on an app and have a small problem when the soft keyboard is shown before switching activities. This happens when:
The user hits the search button
They enter a search term, view the search in a new activity and then return to the previous page
When the user returns to the previous page, a black box flashes where the soft keyboard was and then returns to normal
If the list is turned off or empty this problem never manifests. I have tried to enable caching of the listview children, hiding the listview when the activity pauses but to no avail. I would really appreciate any insight into why this might be occuring.
Thanks,
Laurence

Thought I'd follow up.
This problem was specific to pre Android 3.0 devices. On HC, ICS and JB this is no longer exhibited. As simple way to get around this on older versions of Android is to just change the windows background to match the color of your view. It still is blanked out but no where near as noticeable as black on white.

Related

.NET MAUI Entry keyboard does not hide

I have a very simple UI that has one entry control to enter phone number and a button. The entry control has a handler for removing border around it. When the entry control got focus, keyboard pops up. But when I try to tap outside the entry control such as on the screen empty area, the keyboard does not dismiss and the entry control does not lose focus. Also since the button is at the bottom of the screen, therefore, the soft keyboard hides it and there is no way to tap the button. The button can only be tapped if I press the Android device back button.
At present, I have not checked this behavior on an iOS device.
This was not a problem in Xamarin Forms though. I searched a lot on Internet and found that it is currently a bug in MAUI.
I tried to attach a tap gesture on the parent layout control and invoked platform-specific code to hide the keyboard but it seems the entry does not lose focus and in turn the tap gesture event is never called.
However, the entry control should lose focus automatically when I tap outside the entry control (such as on the screen) and the soft keyboard should automatically dismiss.
Please provide a workaround if there is any.
Known bug. Removing the focus sometimes helps. Sometimes you need to do Disable/Enable in sequence. (I go with the second).
If you want, you can read this for example:
https://github.com/dotnet/maui/issues/12002
(Most disturbing part, considering this is know bug for half year+)
We can leave the behavior how this is for now in NET7 and provide an
API in NET8 that lets users toggle this behavior on/off for iOS and
Android

Android 11, keyboard bottom area is not working after app launched via Custom launcher and then back from app Recent List

In Android-11, I enabled the Gesture navigation in the Android System Settings and launched a sample application(which contains only one editText on the Screen) using my custom App Launcher. you can see in the below screenshot,
Gesture Navigation means there is no 3-button navigation, similar behavior of iPhones behavior,
You can see in the above image at the keyboard bottom, that there is some additional space available, so in order to remove the space, I used the below code to hide that
WindowInsetsController wcon = getWindow().getInsetsController();
wcon.hide(WindowInsets.Type.navigationBars());
wcon.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
So, after I used the code, I got the expected behavior as below, in this stage everything is working fine, (the additional area is hided)
But,
Once I moved this from recent apps like below and again moved back from the normal stage, the Bottom keyboard area touch is not working, I highlight using the Red Color,
This only happens, when I launched the app using Custom App
What went wrong with this behavior, Why is the bottom area not working?

How to make in app custom keyboard behave like a system keyboard?

I have an in app keyboard that tries to behave like a system keyboard. So far it pops up from the bottom using Bottom Sheet, which is great.
However, unlike a system keyboard, it does not push the entire layout up when you select an EditText that might otherwise get hidden. So far all the solutions I saw on StackOverFlow seem to be about Soft/System Keyboard not an in-app implementation like mine.
Here is my activity with 3 Edit Texts
This is what happens if I click on the last Edit Text. It gets covered by the keyboard in blue
This is how I want it to be. Everything getting pushed up.
How can I achieve this?

How to change the onscreen button

I looked for the question everywhere on the Internet but can't find the answer. What I found is to hide the whole button tray all together.
When the keyboard is down, the button is shown as in the picture.
But when the keyboard is showing the icon changes to -
My problem is to change the button (as in the second image), when my emoticons are showing. So, is there any way by which I can programatically change the button on an event and change it back on another event?
I'm afraid this is not possible yet. Perhaps this will be implemented in later versions of Android.
Not all devices have an onscreen navigation bar, a lot of devices still have hardware buttons.
Nevertheless, you'll might find this article interesting: http://arpitonline.com/blog/2014/07/27/improving-androids-navigationbar/

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.

Categories

Resources