mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-29 10:43:15 +01:00
e10c587dc5
The meaning of the public fields of KeyValue was quite complicated and not handled consistently accross the app. Make these fields private and add a more abstract API on top. The meaning of these fields changed recently and it wasn't an easy change. I plan on making more changes in the future.
29 lines
723 B
Java
29 lines
723 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.getString());
|
|
if (_key.hasFlags(KeyValue.FLAG_KEY_FONT))
|
|
setTypeface(Theme.getSpecialKeyFont(context));
|
|
}
|
|
|
|
public void onClick(View v)
|
|
{
|
|
Config config = Config.globalConfig();
|
|
config.handler.handleKeyUp(_key, Pointers.Modifiers.EMPTY);
|
|
}
|
|
}
|