android-input-method

add custom image as Emoji in android

懵懂的女人 提交于 2019-12-03 08:17:43
how to add custom image as emoji in android InputMethodService. i have tried using ImageGetter imageGetter = new ImageGetter() { public Drawable getDrawable(String source) { StringTokenizer st = new StringTokenizer(str, "."); Drawable d = new BitmapDrawable(getResources(),emoticons[Integer.parseInt(st.nextToken()) - 1]); d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); return d; } }; Spanned cs = Html.fromHtml("<img src ='"+ str +"'/>", imageGetter, null); getCurrentInputConnection().commitText(cs,1); but only getting a obj text image. is there any way to add custom emoji to

display built-in emoji keys for inputmethod

落爺英雄遲暮 提交于 2019-12-03 07:14:48
I'm building a custom soft keyboard for android and would like to add a layout to include the emoji keys similar to what the default android keyboard (AOSP) is doing. I've searched around but it seems that most people are trying to display custom emoji from images. I'm looking to show the built-in icons that comes with Android (as shown below): It seems that I should be able to use the Unicode characters to send images from the keyboard, but my first attempt seems to generate only the older versions of the emojis. How do I support the latest emoji the phone can handle? Also, how do I display

Android show softkeyboard with showSoftInput is not working?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:42:17
问题 I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open. My code does not work?! I have tried various "state" settings in the manifest and different flags in the code to the InputMethodManager (imm). I have included the setting in the AndroidManifest.xml and explicitly invoked in the onCreate of the only activity. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas

Custom EditText is not showing keyboard on focus

馋奶兔 提交于 2019-12-03 01:34:33
I am creating a custom EditText class because i need to set some custom fonts; However now when i click on the editText the android keyboard does not pop up anymore... here is my class: package ro.gebs.captoom.utils.fonts; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Rect; import android.graphics.Typeface; import android.util.AttributeSet; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import ro.gebs.captoom.R; public class CustomFontEditText extends EditText { private Context context; public

Hide Soft keyboard on return key press

时光怂恿深爱的人放手 提交于 2019-12-03 01:05:53
I've searched half a dozen other answers on SO, but haven't found one that works. All I'm trying to do is dismiss the soft keyboard when the user presses the enter button. (The equivalent of the insanely easy iOS 'resignKeyboard' call.) In the following code, the onEditorAction method does not get called. I've set up an EditText view in my XML file and the code in my fragment is as follows: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { fragView = inflater.inflate(R.layout.fragment_encrypt2, container, false); textField = (EditText

how to call an activity when getting incoming call.

瘦欲@ 提交于 2019-12-03 00:47:46
Hi all i want to invoke a my own activity over the default incoming call activity.. i have done this with using broadcast receivers i am invoking my activity when getting incoming call. but it is working fine for first time from second time when i get incoming call then default incoming call activity is coming over my activity . i don't know what is the problem can any one please help me .. Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.satish.service" android:versionCode="1" android:versionName="1.0" > <uses

Better way to get all the text in an EditText from an InputConnection?

我是研究僧i 提交于 2019-12-02 23:42:28
I've written an IME (InputMethodService) and I need to get all the text from the EditText it is editing. I know one way: InputConnection inputConnection = getCurrentInputConnection(); inputConnection.append(inputConnection.getTextBeforeCursor(9999, 0)) .append(inputConnection.getTextAfterCursor(9999, 0)); It works, but it seems pretty stupid and clunky. However there is no such method InputConnection.getText() . Is there a better way? P.S. I cannot access the EditText from my IME because it belongs to the parent app so please don't tell me to use EditText.getText(), unless you know a way to

Disable hard keyboard input for EditText in Android

我只是一个虾纸丫 提交于 2019-12-02 15:32:44
问题 I'm new to android and I need to set a EditText to use soft keyboard input only. It should not display any text that I type using the hard keyboard.is this possible ? Update: I use the hard keyboard input to track key events using onKeyDown method in Activity class and perform a separate task, problem comes when a EditText field is focused, it displays what ever the key I pressed using the hard keyboard. I need to avoid this and let only soft keyboard inputs into a particular EditText field

In Android Custom Keyboard, how to change Alphabets Keyboard to Symbols Keyboard?

你。 提交于 2019-12-02 11:22:05
While Navigate User from Alphabets Keyboard to Symbols Keyboard, Layout Alignment gets spoiled. By Default, Layout takes 5dp padding & User can't see the Last Column Keys. Note: Images shown in below. I handled Key Actions to Navigate User from Alphabets Keyboard to Symbol Keyboard in the onKey Method override fun onKey(primaryCode: Int, keyCodes: IntArray?) { when (primaryCode) { KEYCODE_ALPHABETS -> { keyboardView?.keyboard = Keyboard(this, R.xml.keyboard) } KEYCODE_SYMBOLS_1 -> { keyboardView?.keyboard = Keyboard(this, R.xml.keyboard_symbols_1) } KEYCODE_SYMBOLS_2 -> { keyboardView?

EditText with textPassword inputType, but without Softkeyboard

非 Y 不嫁゛ 提交于 2019-12-02 07:44:53
i wanted to create an EditText with an android:inputType="textPassword. However i also do not want to use the SoftKeyboard for input. So i tried setting InputMethod to null, but this would also disable the textPassword features of replacing password rendering to " * [lastchar]". Is there any other way to disable the softKeyboard from showing up? Uhm just figured it out myself: Simply use: pinInput.setOnClickListener(new OnClickListener() { public void onClick(View v) { InputMethodManager mgr = (InputMethodManager) Pin.this.getSystemService(Context.INPUT_METHOD_SERVICE); mgr