Unexpected-Keyboard/srcs/juloo.keyboard2/EmojiGroupButtonsBar.java
Jules Aguillon e10c587dc5 Refactor: Abstract KeyValue fields
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.
2022-06-05 17:46:22 +02:00

27 lines
781 B
Java

package juloo.keyboard2;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
public class EmojiGroupButtonsBar extends LinearLayout
{
public EmojiGroupButtonsBar(Context context, AttributeSet attrs)
{
super(context, attrs);
Emoji.init(context.getResources());
add_group(EmojiGridView.GROUP_LAST_USE, "\uD83D\uDD59");
for (int i = 0; i < Emoji.num_groups; i++)
{
Emoji first = Emoji.getEmojisByGroup(i)[0];
add_group(i, first.getString());
}
}
private void add_group(int id, String symbol)
{
addView(new EmojiTypeButton(getContext(), id, symbol), new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1.f));
}
}