Unexpected-Keyboard/srcs/juloo.keyboard2/EmojiTypeButton.java
Jules Aguillon a165a0ab2e Update the list of emojis
Take the list from https://unicode.org/Public/emoji/13.1/emoji-test.txt
Also change the list of groups, from the same source.
2021-01-17 00:20:09 +01:00

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);
}
}