Merge 540dcd8603
into ab72435347
This commit is contained in:
commit
55987ecb59
2 changed files with 19 additions and 7 deletions
|
@ -111,12 +111,13 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||
list.setPadding(V.dp(16), 0, V.dp(16), 0);
|
||||
imgLoader=new ListImageLoaderWrapper(activity, list, new RecyclerViewDelegate(list), null);
|
||||
|
||||
List<Emoji> recentEmoji=new ArrayList<>(lp.recentCustomEmoji);
|
||||
if(!recentEmoji.isEmpty())
|
||||
adapter.addAdapter(new SingleCategoryAdapter(recentEmojiCategory=new EmojiCategory(activity.getString(R.string.mo_emoji_recent), recentEmoji)));
|
||||
|
||||
for(EmojiCategory category:emojis)
|
||||
adapter.addAdapter(new SingleCategoryAdapter(category));
|
||||
if (!forReaction){
|
||||
List<Emoji> recentEmoji=new ArrayList<>(lp.recentCustomEmoji);
|
||||
if(!recentEmoji.isEmpty())
|
||||
adapter.addAdapter(new SingleCategoryAdapter(recentEmojiCategory=new EmojiCategory(activity.getString(R.string.mo_emoji_recent), recentEmoji)));
|
||||
for(EmojiCategory category : emojis)
|
||||
adapter.addAdapter(new SingleCategoryAdapter(category));
|
||||
}
|
||||
list.setAdapter(adapter);
|
||||
list.addItemDecoration(new RecyclerView.ItemDecoration(){
|
||||
@Override
|
||||
|
@ -229,6 +230,17 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
|
|||
}
|
||||
}
|
||||
|
||||
public void customToggleKeyboardPopup(){
|
||||
if (adapter.getAdapterCount() == 0){
|
||||
List<Emoji> recentEmoji=new ArrayList<>(lp.recentCustomEmoji);
|
||||
if(!recentEmoji.isEmpty())
|
||||
adapter.addAdapter(new SingleCategoryAdapter(recentEmojiCategory=new EmojiCategory(activity.getString(R.string.mo_emoji_recent), recentEmoji)));
|
||||
for(EmojiCategory category : emojis)
|
||||
adapter.addAdapter(new SingleCategoryAdapter(category));
|
||||
}
|
||||
super.toggleKeyboardPopup(null);
|
||||
}
|
||||
|
||||
private class SingleCategoryAdapter extends UsableRecyclerView.Adapter<RecyclerView.ViewHolder> implements ImageLoaderRecyclerAdapter, Filterable{
|
||||
private EmojiCategory category;
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem {
|
|||
public void onBackspace() {}
|
||||
|
||||
private void onReactClick(View v){
|
||||
emojiKeyboard.toggleKeyboardPopup(null);
|
||||
emojiKeyboard.customToggleKeyboardPopup();
|
||||
v.setSelected(emojiKeyboard.isVisible());
|
||||
space.setVisibility(emojiKeyboard.isVisible() ? View.VISIBLE : View.GONE);
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
|
|
Loading…
Add table
Reference in a new issue