Easier reusability of TimeBar core logic
Open
@icbaker is already working on this.
Since Aug 17, 2022.
enhancement
low priority
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
[REQUIRED] Use case description
Writing my own Player UI with my own controls for my Podcast app.
While Timebar has some good configuration options, the internal logic of calculating the time and scrubbing is implemented inside PlayerControlView.
It's quite a lot:
- https://github.com/androidx/media/blob/fe0cf0528318abf1a9a7a8f75bcce402235f961a/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java#L277-L281
- https://github.com/androidx/media/blob/fe0cf0528318abf1a9a7a8f75bcce402235f961a/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java#L316-L320
- https://github.com/androidx/media/blob/fe0cf0528318abf1a9a7a8f75bcce402235f961a/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java#L1156-L1272
- https://github.com/androidx/media/blob/fe0cf0528318abf1a9a7a8f75bcce402235f961a/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java#L1541-L1559
Plus a few other variables.
Proposed solution
TimeBarDelegate which contains all of this logic and can be used outside the PlayerControlView class.
Alternatives considered
Copy pasting everything, which is what I'm doing now.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.