Add vertical scroll to Emoji Keyboard.

This commit is contained in:
Cody Henthorne
2021-06-25 16:39:04 -04:00
committed by GitHub
parent a71fe0fd75
commit ed4bab1b8b
10 changed files with 334 additions and 121 deletions

View File

@@ -45,7 +45,7 @@ final class ReactWithAnyEmojiRepository {
emojiPages.addAll(Stream.of(EmojiSource.getLatest().getDisplayPages())
.filterNot(p -> p.getIconAttr() == EmojiCategory.EMOTICONS.getIcon())
.map(page -> new ReactWithAnyEmojiPage(Collections.singletonList(new ReactWithAnyEmojiPageBlock(getCategoryLabel(page.getIconAttr()), page))))
.map(page -> new ReactWithAnyEmojiPage(Collections.singletonList(new ReactWithAnyEmojiPageBlock(EmojiCategory.getCategoryLabel(page.getIconAttr()), page))))
.toList());
}
@@ -89,29 +89,4 @@ final class ReactWithAnyEmojiRepository {
}
});
}
private @StringRes int getCategoryLabel(@AttrRes int iconAttr) {
switch (iconAttr) {
case R.attr.emoji_category_people:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__smileys_and_people;
case R.attr.emoji_category_nature:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__nature;
case R.attr.emoji_category_foods:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__food;
case R.attr.emoji_category_activity:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__activities;
case R.attr.emoji_category_places:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__places;
case R.attr.emoji_category_objects:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__objects;
case R.attr.emoji_category_symbols:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__symbols;
case R.attr.emoji_category_flags:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__flags;
case R.attr.emoji_category_emoticons:
return R.string.ReactWithAnyEmojiBottomSheetDialogFragment__emoticons;
default:
throw new AssertionError();
}
}
}