Skip to content

Conversation

@rishabhhgupta
Copy link

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

This pull request introduces a complete emoji search feature to enhance usability and make emoji selection faster and more intuitive.

Key improvements include:

  • Added a search bar to the emoji palette UI.
  • Implemented OtherInputConnection.kt to allow typing into the AppCompatAutoCompleteTextView used for emoji search.
  • Added a new view for displaying search results; shows recent emojis by default and updates based on user queries.
  • Added multiple CSV files (emoji_category_*.csv) containing emojis and search keywords for all categories.
  • Updated EmojiHelper.kt to parse the CSV files and added the new searchEmojis function.
  • Integrated search logic into MyKeyboardView.kt, handling focus changes and input routing.
  • Added supporting UI elements: new strings, colors, and a search icon.
  • Modified SimpleKeyboardIME.kt to switch between the default input connection and OtherInputConnection when the search view is active.
  • Added new methods to OnKeyboardActionListener.

Tests performed

  • Manual testing on Android device - Android 15 and on Emulators android 13 and 14.

Before & after preview

Video demonstration

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes.
  • I updated CHANGELOG.md.
  • I self-reviewed my pull request.
  • All checks are passing.

…view

This commit introduces a comprehensive emoji search feature and the necessary infrastructure to support it.

Key changes include:
- Adds a search bar to the emoji palette.
- Implements `OtherInputConnection.kt` to handle text input into the `AppCompatAutoCompleteTextView` used for emoji search, allowing the keyboard to type into the search field.
- Creates a new view for displaying emoji search results, which shows recent emojis by default and updates based on the user's query.
- Adds CSV files (`emoji_category_*.csv`) containing emojis and associated search keywords for various categories (People, Nature, Food, etc.).
- Updates `EmojiHelper.kt` to parse the new CSV files and adds a `searchEmojis` function.
- Integrates the search logic into `MyKeyboardView.kt`, handling focus changes and text input for the search bar.
- Adds new string resources, colors, and a search icon to support the UI changes.
- Modifies `SimpleKeyboardIME.kt` to switch between the standard input connection and the new `OtherInputConnection` when the emoji search is active.
- Introduces new methods in the `OnKeyboardActionListener` interface for handling search view focus and updating the shift state.
Improve emoji handling and add constants

This commit introduces several improvements to the emoji handling functionality:

- **Refactors emoji search and recents:**
    - Defines a `MAX_RECENT_EMOJIS` constant for clarity when retrieving recently used emojis.
    - Adds a `MAX_SEARCH_RESULTS` constant to limit the number of emojis returned from a search.
- **Enhances error handling:**
    - Improves exception handling in `getEmojisFromAssets` to catch more specific `IOException`, `IllegalArgumentException`, and `IndexOutOfBoundsException` during emoji file parsing.
    - Adds specific `IOException` and `JSONException` handling when parsing raw JSON files.
- **Code cleanup:**
    - Simplifies conditional logic in `getEmojisFromAssets`.
Replaces the `IndexOutOfBoundsException` catch block with a more general `IOException` to handle potential file reading errors. This provides more robust error logging when processing emoji data files.
@rishabhhgupta
Copy link
Author

I'm androidx.emojipicker guy

@rishabhhgupta
Copy link
Author

Dude I'm waiting. Are you reviewing the changes or is something is wrong here, if something has then please mention me, I will fix that

@naveensingh
Copy link
Member

Yes, I'll check this soon.

@rishabhhgupta
Copy link
Author

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants