mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-22 23:33:11 +01:00
a165a0ab2e
Take the list from https://unicode.org/Public/emoji/13.1/emoji-test.txt Also change the list of groups, from the same source.
38 lines
976 B
Java
38 lines
976 B
Java
package juloo.keyboard2;
|
|
|
|
import android.content.Context;
|
|
import android.view.ContextThemeWrapper;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.Button;
|
|
|
|
/* Emoji "types" are groups. This class is misnamed. */
|
|
|
|
public class EmojiTypeButton extends Button
|
|
implements View.OnTouchListener
|
|
{
|
|
private int _emojiType;
|
|
|
|
static private final int DEFAULT_GROUP = 0;
|
|
|
|
public EmojiTypeButton(Context context, int group_id, String symbol)
|
|
{
|
|
super(new ContextThemeWrapper(context, R.style.emojiTypeButton), null, 0);
|
|
_emojiType = group_id;
|
|
setText(symbol);
|
|
setOnTouchListener(this);
|
|
}
|
|
|
|
public boolean onTouch(View view, MotionEvent event)
|
|
{
|
|
EmojiGridView emojiGrid;
|
|
|
|
if (event.getAction() != MotionEvent.ACTION_DOWN)
|
|
return (false);
|
|
emojiGrid = (EmojiGridView)((ViewGroup)(getParent().getParent())).findViewById(R.id.emoji_grid);
|
|
emojiGrid.setEmojiGroup(_emojiType);
|
|
return (true);
|
|
}
|
|
}
|