Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show Custom emoticon in Android Keyboard

I have been trying for the last 3 days to show a graphical custom emoticon in the default android message view. I have successfully shown my custom emoticons in place of keys. Now the problem is that I am trying to show a drawable in spanable string builder. But the drawable just does not appear on the keyboard. Here is the code so far:

     SpannableString ss = new SpannableString(" "); 
                    Drawable d = getResources().getDrawable(R.drawable.a); 
                    d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); 
//                  ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE); 
                    ImageSpan span = new ImageSpan(d);
//                  ss.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);

                    mComposing.append(":");
                    mComposing.setSpan(new ImageSpan(d), 0,1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                    getCurrentInputConnection().commitText(mComposing, 1);

I have tried different methods to somehow fit the drawable but it just wont show on the default message view of android. Any help would be highly appreciated.

like image 440
SoH Avatar asked Feb 01 '13 06:02

SoH


Video Answer


1 Answers

May be this will be helpful: Emoticons-Keyboard

See this also: Implementations of Emoji (Emoticon) View/Keyboard Layouts

like image 126
captaindroid Avatar answered Sep 26 '22 06:09

captaindroid