Drawing outside a view in Android - android

I am developing a soft keyboard IME for android, and I need the ability to overlay something on top of the text that is being inputted.
The android IME API basically asks for a View to be returned, and I can't seem to draw outside this view.
I have seen this on a demo on another IME (I think it was swype?) where a popup on top of the text for the possible words were shown, but I've not been able to replicate this on my Swype/Swiftkey copy.

Related

ImageView in Custom Keyboard

i like to show an image view in my android custom keyboard (in app not a system keyboard). So far i tried adding one but it does not appear in the view. Do you know whether android supports adding custom views into a keyboard ?

Gif Keyboard for Android

How would I go about creating a dynamic Gif keyboard for Android? I would like the user to scroll horizontally across the Gif's and possibly search across them via an integrated search bar in the keyboard
I've seen this link but it doesn't talk about dynamically changing the keys: How to make a Android custom keyboard?
In your InputMethodService there is a callback onCreateInputView()
You can create whatever custom view you want and return in there.
For horizontal scrolling, maybe look at view pager

Adjust layout when soft keyboard is visible

I am developing an application for android devices, which manages TV channels and shows. In it there is an option for the user to add channels in the system using a custom widget. The widget uses autocompleteTextView. My layout does not adjust itself when the soft keyboard appears.
These are the 2 states of the layout:
The keyboard blocks the user from viewing the options in the dropdown and the field below it. I have already tried the solution here and here. But none of them got it to work.
I want to move the layout of the widget itself, rather then the whole layout behind. How to go about this problem?

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.

Showing Keyboard with Android Dialog

I want to show the Android version of a Model Dialog with text input however I think the keyboard will be behind the actual activity since dialogs weren't made to have inputs. Is there any way I can get the keyboard to show in an actual dialog.
I did see this SO question -- however I'd rather not use an Theme.Dialog'ed activity because I feel like an activity would be too heavy for my purposes. How can I show this Model Dialog with the keyboard input in the foreground?
This is what I am talking about:
Who said dialogs aren't made to have inputs?! A dialog can contain anything - text, buttons, progress bars, input fields. Did you try it out? A keyboard resizes your canvas, so there's no "behind"/"front" going on. (Besides, you can always summon the IME on a phone without a QWERTY
keyboard by holding the menu button - even there's a modAl dialog.)
EDIT: If you need proof, just look at the API Demos (App -> Dialog). There's an example for a dialog with text entry. Source code here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.html (DIALOG_TEXT_ENTRY)

Categories

Resources