mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-12-29 09:28:53 +01:00
1cfecbdf48
Use xmllint. Re-indent Java files using spaces.
38 lines
1000 B
Java
38 lines
1000 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);
|
|
}
|
|
}
|