Merged
Conversation
…d performance
- **Playback & State Management**:
- Remove `currentPosition` from `StablePlayerState` to prevent high-frequency updates from triggering global UI recompositions.
- Introduce a dedicated `currentPosition` StateFlow in `PlaybackStateHolder` and `PlayerViewModel` for real-time tracking (e.g., seek bars, lyrics).
- Deprecate `stablePlayerStateInfrequent` in favor of a unified `stablePlayerState`, as structural state changes are now naturally separated from position updates.
- Add `setCurrentPosition` to `PlaybackStateHolder` to provide a centralized way to update playback progress.
- **ViewModel & Logic**:
- Update `PlayerViewModel`, `PlaybackStateHolder`, and `CastTransferStateHolder` to use the new position flow for seek operations, remote playback syncing, and progress tracking.
- Ensure `listeningStatsTracker` continues to receive accurate progress updates via the new position stream.
- **UI Components**:
- Refactor all screens and components (including `UnifiedPlayerSheet`, `LibraryScreen`, `SearchScreen`, and `FullPlayerContent`) to collect `stablePlayerState` and `currentPlaybackPosition` independently.
- Update `LyricsSheet` to use the separated position flow for accurate timing.
- **ComposeLoader**: Refactor `rememberSmoothProgress` to remove heavy `animateFloatAsState` recompositions. Visual interpolation logic is moved to the draw phase of specific components to reduce recomposition frequency from ~60 FPS to ~5 FPS during progress updates.
- **WavySliderExpressive**:
- Implement frame-clock based visual interpolation using `withFrameNanos` to ensure smooth slider movement without triggering high-frequency recompositions.
- Decouple `renderedNormalizedProgress` from the main composition cycle by updating it within a `LaunchedEffect`.
- Consume the interpolated progress value directly in `LinearWavyProgressIndicator` and the thumb drawing logic.
- **FullPlayerContent**: Pass `interactionSource` to the expressive wavy slider to ensure correct interaction state tracking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.