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);
|
2022-06-24 20:26:27 +02:00
|
|
|
String key_name = attrs.getAttributeValue(null, "key");
|
|
|
|
_key = (key_name == null) ? null : KeyValue.getKeyByName(key_name);
|
2022-06-05 17:26:34 +02:00
|
|
|
setText(_key.getString());
|
|
|
|
if (_key.hasFlags(KeyValue.FLAG_KEY_FONT))
|
2022-09-19 11:41:18 +02:00
|
|
|
setTypeface(Theme.getKeyFont(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-11-13 16:18:08 +01:00
|
|
|
config.handler.key_up(_key, Pointers.Modifiers.EMPTY);
|
2021-12-19 19:44:27 +01:00
|
|
|
}
|
2015-10-24 16:32:49 +02:00
|
|
|
}
|