-
-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show categories in emoji picker #3300
base: develop
Are you sure you want to change the base?
Conversation
Why does it need fake grid items (what is missing otherwise or in existing code)? |
I tried using RecyclerView.ItemDecoration with method getItemOffsets and modifying the outRect, but I couldn't get that to work well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the feature, but I'm sorry the code is way to messy to be merged :/
Here are some ideas to improve it:
- do the titles with a second recyclerview, xml layouts and a adapter
- don't touch ComposeActivity at all, it is already doing too much
- move the logic into the one of the other classes, probably EmojiPicker
Categories can be defined for custom emojis in Mastodon.
For example on zug.network, there are over 1800 custom emojis and at least some categories have been introduced, which can be seen in the web interface like in the next screenshot. Meanwhile in Tusky the emojis can only be browsed alphabetically without categories.
In this PR I tried to group custom emojis by category and only sort alphabetically within the group, furthermore there's a kind of header for the emoji picker containing all the categories and highlighting the current one.
When scrolling the emoji grid, the header gets updated, however this bit needs to be improved to suppress this during the smooth scrolling that happens when clicking on a category:
Tusky/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt
Line 1276 in 9bc257d
Besides that, I'm sure some refactoring has to be done since I probably placed some of the code in inappropriate places. The idea of using empty/fake grid items might also be controversial?