mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-22 23:33:11 +01:00
30 lines
693 B
Java
30 lines
693 B
Java
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
|
|
{
|
|
KeyValue _key;
|
|
|
|
public EmojiKeyButton(Context context, AttributeSet attrs)
|
|
{
|
|
super(context, attrs);
|
|
setOnClickListener(this);
|
|
_key = KeyValue.getKeyByName(attrs.getAttributeValue(null, "key"));
|
|
setText(_key.getSymbol(0));
|
|
if ((_key.getFlags() & KeyValue.FLAG_KEY_FONT) != 0)
|
|
setTypeface(((Keyboard2)context).getSpecialKeyFont());
|
|
}
|
|
|
|
public void onClick(View v)
|
|
{
|
|
Keyboard2 main = (Keyboard2)getContext();
|
|
|
|
main.handleKeyUp(_key, 0);
|
|
}
|
|
}
|