abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/EmojiKeyButton.java
blob: 6f662b477028fcc937c5a0354cb78ee469abfcc5 (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(((Keyboard2)context).getSpecialKeyFont());
  }

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