How to set dynamic text to edit text from the custom keyboard - android

I want to set dynamic text to my edit text from the custom keyboard.
For example if I press "a" from the my keyboard then I want to set clipboard data to my edit text.
I use following demo for custom keyboard,
https://github.com/blackcj/AndroidCustomKeyboard
And it work perfect, but I want to just customize it, I want to override my functionality on it, if I am press any of alphabet then I want to perform my action on application edit text.
Please suggest how to do this , and this is possible to paste my clip board data to edittext from the my custom keyboard any key event?

You should have call back method for each key pressed by user, so you can set your custom test to edit text.
You must have class that extends InputMethodService which overrides onKeyDown method where you can write code to set custom text to edit text based on key pressed by user.

Related

How to add accessibility focus on an Edit Text drawable right (Talkback)

I have an editText that contains a drawableRight property. This editText is a search field, and the drawableRight is an "x" icon for clearing the text from the search field. When using Talkback (screen reader), I can't select the drawableRight to trigger my onTouch() event as it thinks I'm trying to tap on the editText as a whole.
I've tried to use .sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED) on my editText drawable, but accessibility functions can only be used on elements that inherit from View.
When I try to access the drawable like this editText.getCompoundDrawables()[4] it doesn't give me any accessibility options, as it does not inherit from View.
I need to find a way to let people with disabilities be able to tap on the "x" drawable from my edit text to clear the search bar text.

How to add a share button to the text selection bar for an EditText?

I notice that when highlighting text in a WebView a share button appears along with the standard copy and select all buttons:
but when highlighting text in a TextView or EditText, there is no such button.
Is there any way to add such a button via XML or can it be done programmatically?
You can achieve that by setting a custom selection action mode using
TextView.setCustomSelectionActionModeCallback(ActionMode.Callback)
and so the EditText
Here's a similar question with that was answered with an example
Also visit TextView.html#setCustomSelectionActionModeCallback

Overriding Defaultkeyboard

I have a cusom view which is programmatically created.I want to show it instead of android default keyboard.for example in the default Messaging app when user goes to compose message default keyboard pop-ups.Is there any way to show the custom view instead of default keyboard.
Is there any event or action fired up to show tha default keyboard so that i can hide the default & show the custom view.please help.
thanks
Is there any way to show the custom view instead of default keyboard
You are welcome to rework your "custom view" to be an input method editor. Users can then choose to use your input method editor if they wish. You cannot force users to use your input method editor.

Add buttons on Custom Keyboard IME in android

I wish to add custom buttons to the android IME. So I have created an InputMethodService extension as done with soft keyboard sample from code samples. But in SoftKeyboard sample a candidate view is been used to add predictive text. So I was try to use the same approach but how can I listen to onclick events when I add button on the candidate view. Is this the best way to add buttons above keyboard?
How can I change the background of each letter in the keyboard already provided or even change the buttons?
Thanks,
nil

Android Floating EditBox

I have an OptionMenu which has single option in it named "Search". When the search option is clicked, it should dynamically add a EditText at the top of Activity window like it has in WebView (browser address bar) so users could search something in my application.
After there would be EditBox, one can write inside it. I also want to have some OnTextChanged like event of that EditBox so do you think it's also available with that View?
I made it myself. I added an EditText on the screen with setting as hidden and on button click made it visible. It worked like a charm.

Categories

Resources