android sdk custom keyboard not moving app - android

I think this issue was posted before. I'm having a custom keyboard and I need to make the app move above it like the softKeyboard with adjust does. Is it possible to do this? Can WindowManager help in any way?
if it's not possible, is it possible to assign a custom soft keyboard to an editbox in the app without prompting the user the dialog for choosing the custom soft keyboard?
Thank you

Can WindowManager help in any way?
WindowManager won't help here, but if you add your entire Keyboard layout to the end of your Activity's layout tree, it should push all other elements up. Using the WindowManager will allow you to "float" the keyboard above the rest of your View.
without prompting the user the dialog for choosing the custom soft keyboard?
This is not allowed for security reasons. You could override onTouch() for that EditText and show your own custom keyboard, but that's about all you can do.

Related

Is there any way to provide animation for soft keyboard appearance in android?

Keyboard handling is still a major setback in Android app development. Let me be specific about my question, I want to provide animation for soft keyboard appearance. I know it is not feasible directly but do anyone know any workaround / tweaks & tricks for this?
you can try creating a custom soft keyboard and register your edittext to load this keyboard (take a look at the plethora of custom keyboards you can use https://android-arsenal.com/tag/232)
An example is "Floating KeyboardView" https://android-arsenal.com/details/1/5247 shows you how you can customise your keyboard.
Use it as normal keyboard view and
Place FloatingKeyboardView inside a FrameLayout or a RelativeLayout
(TIP: Put it last or/and with some elevation)
Make an xml with your keyboard layout
(https://developer.android.com/reference/android/inputmethodservice/Keyboard.html)
Declare it in activity code
FloatingKeyboardView mCustomKeyboard = (FloatingKeyboardView) findViewById(R.id.keyboardview);
Assign the keyboard layout
mCustomKeyboard.setKeyboard(new Keyboard(this, R.xml.numkbd));
Register edittexts to use it
mCustomKeyboard.registerEditText(R.id.edittext1);

How to disable onscreenkeyboard in libgdx (android)

I have created my own onscreenkeyboard. When i focus to textfield it will automatically popup the keyboard. If i add Gdx.input.setOnscreenKeyboardVisible(false), to the focusing method the keyboard will show up anyway for a second. Has anyone got a workaround for this?
Thanks!
According to the documentation, you should be able to do setOnScreenKeyboard() and supply your custom OnScreenKeyboard implementation. My guess is that it is trying to call show() on both your keyboard and the default keyboard. Setting the keyboard to use will prevent the default from showing up.

Hide view when showing keyboard

I have two EditText views and one ImageView. My goal is to hide the ImageView when i am showing the keyboard (When the user have clicked on one of the EditText fields)
Then show the imageView again when the user have unfocused the EditText field or the keyboard is not visible anymore.
I have tried tons of different ways to do this. But nothing really works as intended. Do you guys have any idea how i could achieve this
Have you tried to detect if the keyboard is opened ? How do I Detect if Software Keyboard is Visible on Android Device?
Make debug and when is opened try to hide image . imageview.setvisibility (GONE)
if it does not work you can try to change layout
Make 2 layouts and switch visibility if the keyboard is open /closed
You can add a OnFocusChangeListener to the EditText,when you click the EditText,it will get focus,and then you can hide the ImageView.
<activity android:name="SearchResultsActivity"
android:windowSoftInputMode="adjustPan"/>
adjustPan:
The activity’s main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.
regards! :)
You can do one thing, place UIView-> UIImageView -> UITextfield1-> UITextField2.Handle the UIImageView hiding state in textfield delegates which are Begin and End editing delegate methods

Custom keyboard containing scrollview

I've been trying to create a custom android keyboard. I've started looking over "Creating an Input Method" guide from Google and I was able to create a regular keyboard using the Keyboard and KeyboardView elements.
The problem is that my keyboard needs a scrollview (or a recyclerview) so the user can scroll and see more items of the keyboard - but I don't think this can be achieved using the default Keyboard and KeyboardView elements.
I also tried to override the onCreateInputView method and add a custom layout that contained a scrollview - but the height of the keyboard was taking the entire screen and the user couldn't interact with the app anymore.
So if anyone has some ideas on how I can overcome this issues I would love to hear your suggestions.
Thanks

Removing navigation buttons from android soft keyboard?

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

Categories

Resources