Automattic / Automattic/pocket-casts-android
Would be good for the Android app to support the same keyboard shortcuts as iOS
- Dominant language
- Kotlin
- Stars
- 2.8k
- Forks
- 308
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 187
Description
Not a high priority compared to some of the other things we work on, but worth capturing. Here is the iOS list:
```
func setupKeyboardShortcuts() {
// playback
addKeyCommand(playPauseCommand)
let skipBackCommand = UIKeyCommand(input: UIKeyCommand.inputLeftArrow, modifierFlags: [.command], action: #selector(handleSkipBack), discoverabilityTitle: "Skip Back")
addKeyCommand(skipBackCommand)
let skipForwardCommand = UIKeyCommand(input: UIKeyCommand.inputRightArrow, modifierFlags: [.command], action: #selector(handleSkipForward), discoverabilityTitle: "Skip Forward")
addKeyCommand(skipForwardCommand)
let openPlayerCommand = UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [.command], action: #selector(handleOpenPlayer), discoverabilityTitle: "Open Player")
addKeyCommand(openPlayerCommand)
let closePlayerCommand = UIKeyCommand(input: UIKeyCommand.inputDownArrow, modifierFlags: [.command], action: #selector(handleClosePlayer), discoverabilityTitle: "Close Player")
addKeyCommand(closePlayerCommand)
let decreaseSpeedCommand = UIKeyCommand(input: "[", modifierFlags: [.command], action: #selector(handleDecreaseSpeed), discoverabilityTitle: "Decrease Speed")
addKeyCommand(decreaseSpeedCommand)
let increaseSpeedCommand = UIKeyCommand(input: "]", modifierFlags: [.command], action: #selector(handleIncreaseSpeed), discoverabilityTitle: "Increase Speed")
addKeyCommand(increaseSpeedCommand)
// navigation
let podcastsCommand = UIKeyCommand(input: "1", modifierFlags: [.command], action: #selector(handlePodcasts), discoverabilityTitle: "Podcasts")
addKeyCommand(podcastsCommand)
let filtersCommand = UIKeyCommand(input: "2", modifierFlags: [.command], action: #selector(handleFilters), discoverabilityTitle: "Filters")
addKeyCommand(filtersCommand)
let discoverCommand = UIKeyCommand(input: "3", modifierFlags: [.command], action: #selector(handleDiscover), discoverabilityTitle: "Discover")
addKeyCommand(discoverCommand)
let profileCommand = UIKeyCommand(input: "4", modifierFlags: [.command], action: #selector(handleProfile), discoverabilityTitle: "Profile")
addKeyCommand(profileCommand)
let searchCommand = UIKeyCommand(input: "f", modifierFlags: [.command], action: #selector(handleSearch), discoverabilityTitle: "Search")
addKeyCommand(searchCommand)
}
```
With play/pause just being the space bar, iOS had issues with this triggering while in input fields in our app though, which it had to work around.
Contributor guide
Research direction
Use the iOS setupKeyboardShortcuts list in the issue as the behavior reference, then locate the Android app's keyboard and input-field handling. Implement equivalent playback and navigation shortcuts, ensuring they do not trigger while typing in input fields; done means the listed shortcuts work consistently without that conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100