Unexpected-Keyboard/srcs/juloo.keyboard2/EmojiKeyButton.java

29 lines
723 B
Java
Raw Normal View History

2015-10-24 16:32:49 +02:00
package juloo.keyboard2;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
public class EmojiKeyButton extends Button
implements View.OnClickListener
2015-10-24 16:32:49 +02:00
{
KeyValue _key;
2015-10-24 16:32:49 +02:00
public EmojiKeyButton(Context context, AttributeSet attrs)
{
super(context, attrs);
setOnClickListener(this);
_key = KeyValue.getKeyByName(attrs.getAttributeValue(null, "key"));
setText(_key.getString());
if (_key.hasFlags(KeyValue.FLAG_KEY_FONT))
setTypeface(Theme.getSpecialKeyFont(context));
}
2015-10-24 16:32:49 +02:00
public void onClick(View v)
{
Config config = Config.globalConfig();
config.handler.handleKeyUp(_key, Pointers.Modifiers.EMPTY);
}
2015-10-24 16:32:49 +02:00
}