Android :prevent EditText from rendering Emoji - android

What I need is to stop edittext from Rendering system default Emojis
and use my own emojis with the same rendering way ( unicodes ) , so I DONT to FILTER the Text so it wont pass the text between a range so that emojis wont show up and I just don't know which method to override or remove from default EditText to stop this rendering . the casue I need to do this is that whenever I want to render my own emojis it will first be rendered to system default emojis and quickly changes the span to mine and this isn't nice
if I use filters then I wont be able to enter any emojis with Unicode so filtering by emoji Unicode range is not the ANSWER !

in EditText xlm set attribute
app:emojiCompatEnabled="false"
it will stop render emoji by AppCompat

Related

How to use phonetic edit-text or Search-view in Android?

Like, I will write using a English keyboard but in EditText/SearchView the font will become Phonetic [bangla]. How can I achieve this ?
Example
The process is called transliteration. There are libraries available that can do that. The Google Translate library is one such example.
I'm thinking:
Enter text in your edit text.
Send it to Library.
Show a loading indicator.
Receive the transliterated response from Library.
Set it in your edit text
Hide loading indicator.

Include emoji in button string

I am trying to have a button with an emoji character within the text string for that button. I know there is a way to do this in iOS, is there a way to do this in Android?
In Android, you use Spannable to display images inline with text (which is similar to the iOS 'NSAttributedString` concept, I believe).
This should work for TextView Button and EditText and there are many references / examples available, depending on your needs.
Check out the answer over here:
how set emoji by unicode in a textview?
You have to use unicodes unlike in iOS where you can add them directly

how to replace emoji in android softkeyboard

To display the emoji button in the soft keyboard I use this in the EditText:
android:inputType="textShortMessage"
which uses the emoji icons for my device (which may be specific to my carrier/phone model).
I want to use my own set of drawables instead. Is there a way to do this without having to create a completely new soft keyboard?
No, there isn't any single line solution, maybe there is one at Lollipop as it is shipped with emoticons.
Options:
Implement a keyboard (needs a lot of effort + user to change his default keyboard)
Implement a panel/dialog that act as keyboard (needs less effort)
Use an existing library to do so a list of libraries is here but you can search for more if you want!
I was able to solve this by using the EmojiHandler from here:
To get the unicode of the emoji from textual message content:
String s = EmojiHandler.decodeJava(content);
// use decoded string to display emoji in TextView, Button, etc
textButton.setText(s);
To encode the emoji from the softkeyboard and put it into a String:
String encodedEmoji = EmojiHandler.encodeJava(msgText);

How to enter special characters in an EditText in Android?

Is there any way to input special characters (which are not present in the default soft keyboard ,eg. theta) in an Android EditText?
Thanks..
Well as per your need, I would like to suggest to create a custom keyboard because the stock keyboard which comes with the device may not have the special characters you need.
You can refer the following tutorial to create a custom keyboard
http://www.fampennings.nl/maarten/android/09keyboard/index.htm
or you can see this search result which may serve your purpose,
https://github.com/search?q=android+custom+keyboard&ref=cmdform
And from below site you can get the list of Unicode characters which Android supports,
http://en.wikipedia.org/wiki/List_of_Unicode_characters
http://unicode-table.com/en/#0026
Note: Writing the whole code to create a custom keyboard is beyond the scope of this answer, so I mentioned the reference link.
What you are going to do is to create a custom keyboard. First thing you want is to hide the default keyboard when an EditText is focused:
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Now, you must create a custom layout (RelativeLayout or Multiple LinearLayouts this is your desire), create and set text to the buttons that you want to show. Make this keyboard view setVisibility(View.INVISIBLE) or setVisibility(View.GONE), and whenever your EditText is focused, make it setVisibility(View.VISIBLE).
After keyboard is visible, programming the rest is up to you it is practically easy.
If you also need a guide, here is an example.

display multiline/multiple characters as key label on soft keyboard keys

Hi i am working on android soft keyboard. Normally labels displayed on
keys are single character as shown below
the above one is done by just using keylabel attribute of Key tag in Keyboard
to display whatever text we want on the key. But now my requirement is to display multiple characters on single key as shown below
I got one solution to this by using android:keyIcon but limitation is I need the color of characters to be configurable so that a user can change color of any character. Like 1 with red, | with blue, q with green. So it must be configurable to any color.That's why I skipped keyIcon property for displaying text on character.
So is there any way to set multiple characters on key.
The standard KeyboardView provided by android framework doesn't support displaying secondary text (or multiple characters). To achieve your desired functionality you need to subclass the KeyboardView(or simply View) and implement its onDraw method and draw directly to the Canvas.
You can check the source code of latinIME KeyboardView where its been implemented using hint label.
Also you need to write your own parser for parsing the Keyboard xml. you can check here how its done in LatinIME.
Understanding the complete package Keyboard in LatinIME will be very helpful for your requirement.
Hi I have done it with by taking reference of Customize the appearance of a <Key>
By playing with given code after three days i have got my solution.

Categories

Resources