mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-12-28 17:08:48 +01:00
ab987c776c
The "loc " prefix for predefining a place for an "extra key" was broken
since 31d6a70
.
The FLAG_LOCALIZED flag cannot be used anymore, as adding it to any key
would turn it into a different key that wouldn't be recognized by parts
of the code comparing the keys (placing the extra keys).
Add an other layer in KeyboardData to store such informations.
30 lines
783 B
Java
30 lines
783 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);
|
|
String key_name = attrs.getAttributeValue(null, "key");
|
|
_key = (key_name == null) ? null : KeyValue.getKeyByName(key_name);
|
|
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);
|
|
}
|
|
}
|