IPL / iOSStyleEditText

An EditText to support displaying iOS Emoji characters
26 stars 9 forks source link

Issue in erasing a emoji #1

Closed rohanrajadhyaksha closed 10 years ago

rohanrajadhyaksha commented 10 years ago

I am not able to erase emoji with single hit of backspace button,i had hit it many times,i have hash map of Unicode ,from which i am appending a Unicode to edit text public class EmojiUtils {

public static HashMap<Integer, String> unicode = new HashMap<Integer, String>();
static
{

    unicode.put(1, "\uD83D\uDE04");//Smiling Face with Open Mouth and Smiling Eyes
    unicode.put(2, "\uD83D\uDE03");//Smiling Face With Open Mouth
    unicode.put(3, "\uD83D\uDE00");//Grinning Face
    unicode.put(4, "\uD83D\uDE0A");//Grinning Face with Smiling Eyes
    unicode.put(5, "\u263A\uFE0F");//Smiling Face

}

and this how i am appending an Unicode to edit text Integer key = index; Log.d("emoji", "index of clicked emoji is" + index); Log.d("emoji", "Unicode of clicked emoji is" + EmojiUtils.unicode.get(key)); SpannableString spannable =new SpannableString(EmojiUtils.unicode.get(key)); //String cs = EmojiUtils.unicode.get(key); int cursorPosition = edtMessage.getSelectionStart(); edtMessage.getText().insert(cursorPosition, spannable);

rohanrajadhyaksha commented 10 years ago

This problem occurs only in micromax devices..Works great in all other devices....

IPL commented 10 years ago

I don't have micromax devices. So it's hard to say where the problem happens. Perhaps I can add more log and you run the app and send the log back to me.

rohanrajadhyaksha commented 10 years ago

Okay..One more issue sir, i tried to edit your sample application as

package com.iosstyle.emojiedittext.sample;

import android.app.Activity; import android.os.Bundle;

import com.iosstyle.EmojiEditText; import com.iosstyle.emojiedittext.sample.R;

public class SampleActivity extends Activity {

private EmojiEditText et;

@Override
public void onCreate(Bundle savedInstanceState)
{
    String unicode = "helo \\uD83D\\uDE00";
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    et = (EmojiEditText) findViewById(R.id.my_edit_text);
    et.setText(unicode);
}

} But it did not gave me desired output device-2014-01-10-130622