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
|
2021-12-19 19:44:27 +01:00
|
|
|
implements View.OnClickListener
|
2015-10-24 16:32:49 +02:00
|
|
|
{
|
2021-12-19 19:44:27 +01:00
|
|
|
KeyValue _key;
|
2015-10-24 16:32:49 +02:00
|
|
|
|
2021-12-19 19:44:27 +01:00
|
|
|
public EmojiKeyButton(Context context, AttributeSet attrs)
|
|
|
|
{
|
|
|
|
super(context, attrs);
|
|
|
|
setOnClickListener(this);
|
|
|
|
_key = KeyValue.getKeyByName(attrs.getAttributeValue(null, "key"));
|
2022-06-05 17:26:34 +02:00
|
|
|
setText(_key.getString());
|
|
|
|
if (_key.hasFlags(KeyValue.FLAG_KEY_FONT))
|
2021-12-28 17:53:58 +01:00
|
|
|
setTypeface(Theme.getSpecialKeyFont(context));
|
2021-12-19 19:44:27 +01:00
|
|
|
}
|
2015-10-24 16:32:49 +02:00
|
|
|
|
2021-12-19 19:44:27 +01:00
|
|
|
public void onClick(View v)
|
|
|
|
{
|
2021-12-28 17:47:18 +01:00
|
|
|
Config config = Config.globalConfig();
|
2022-06-05 01:38:42 +02:00
|
|
|
config.handler.handleKeyUp(_key, Pointers.Modifiers.EMPTY);
|
2021-12-19 19:44:27 +01:00
|
|
|
}
|
2015-10-24 16:32:49 +02:00
|
|
|
}
|