refactor(emoji/recent): rename NEW_RECENT to NEW_RECENT_VALUE

This commit is contained in:
FineFindus 2023-01-02 16:58:31 +01:00
parent 8b12fac766
commit 42fcd6df51
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,8 @@ import me.grishka.appkit.utils.V;
import me.grishka.appkit.views.UsableRecyclerView; import me.grishka.appkit.views.UsableRecyclerView;
public class CustomEmojiPopupKeyboard extends PopupKeyboard{ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
private static final int NEW_RECENT=15; //determines how many emoji need to be clicked, before it disappears from the recent emojis
private static final int NEW_RECENT_VALUE=15;
private List<EmojiCategory> emojis; private List<EmojiCategory> emojis;
private UsableRecyclerView list; private UsableRecyclerView list;
@ -138,10 +139,9 @@ public class CustomEmojiPopupKeyboard extends PopupKeyboard{
if (usageCount != null) { if (usageCount != null) {
recentEmojis.put(emoji.shortcode, usageCount + 1); recentEmojis.put(emoji.shortcode, usageCount + 1);
} else { } else {
recentEmojis.put(emoji.shortcode, NEW_RECENT); recentEmojis.put(emoji.shortcode, NEW_RECENT_VALUE);
} }
Log.e("Emojis", "increaseEmojiCount: " + recentEmojis);
recentEmojis.entrySet().removeIf(e -> e.getValue() <= 0); recentEmojis.entrySet().removeIf(e -> e.getValue() <= 0);
recentEmojis.replaceAll((k, v) -> v - 1); recentEmojis.replaceAll((k, v) -> v - 1);
GlobalUserPreferences.save(); GlobalUserPreferences.save();