abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/EmojiKeyButton.java
blob: 51ff14f61767627e1b5acfba6df412efea7bd6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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.symbol);
    if ((_key.flags & KeyValue.FLAG_KEY_FONT) != 0)
      setTypeface(Theme.getSpecialKeyFont(context));
  }

  public void onClick(View v)
  {
    Config config = Config.globalConfig();
    config.handler.handleKeyUp(_key, 0);
  }
}