Make KeyboardTracker extendable
- Dominant language
- Swift
- Stars
- 4.6k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
Just want to start a discussion about this.
In our app, we have a different design about chat input bar. `Chatto`'s default ChatInputBar and KeyboardTracker provided a very nice example about how to do things. I want to be able to re-use existing functionalities and also add my own by extending KeyboardTracker. Right now, this is not doable.
So maybe we can make KeyBoardTracker public and add methods to allow user to override/extend on each keyboard events. For example, I made some changes based on what I need at here https://github.com/zwang/Chatto/commit/c6b4230459f753202298f476259d0a3dc3bb2808 (There are some other changes I made for my need too, please ignore them for now). We can make a good default for most of people (which it already does) and also easy to extend if needed.
The use case for the change I made above is we want to show the ChatInputbar only half of the width of screen in landscape mode and when user type on the text input, we resize it to full width. So I need to know when user start editing, etc and also be able to adjust the `inputContainerTrailingConstraint` (I created a reference to it and made it public) constraints based on keyboard events.
Contributor guide
Research direction
Start by reviewing KeyboardTracker and ChatInputBar, then compare the requested extension points with the linked commit c6b4230459f753202298f476259d0a3dc3bb2808. Done means KeyboardTracker is publicly reusable and provides agreed hooks for keyboard and editing events, including the constraint adjustment use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100