Impl/beta 7 prep 2#2083
Merged
Merged
Conversation
Reduces recomposition frequency by shifting state reads to the draw and layout phases, particularly for the player sheet and slider components. Introduces a flat track state for the wavy slider when paused and refines marquee text behavior.
- **Performance Optimizations**:
- Converted `WavySliderExpressive` and `AutoScrollingText` to use lambda-based value providers to avoid high-frequency recompositions during playback.
- Moved animation state reads in `PlayingEqIcon` into the `Canvas` block.
- Updated `InfrequentStateSampler` to use `snapshotFlow` instead of fixed polling delays when inactive.
- **UI & Components**:
- Added a flat track drawing mode to `WavySliderExpressive` when `isPlaying` is false.
- Implemented `canScroll` logic for marquee text to ensure scrolling only occurs during active playback or specific expansion states.
- Refactored `MainActivity` and `SheetVisualState` to use a more efficient `DynamicSmoothCornerShape` and simplified padding logic.
- **Layout & Sheet**:
- Improved layout constraints for the mini player in `UnifiedPlayerSheetV2` to ensure proper clipping and sizing.
- Refined shadow elevation logic to account for drag states in the player sheet.
- Cleaned up unused corner radius parameters in player content components.
Replaces hardcoded `12.dp` corner radius values with the dynamic `navBarCornerRadiusDp` variable to ensure visual consistency. Additionally, updates the logic to use standard radius calculations when the navigation bar is in `FULL_WIDTH` style. - Updated corner radius calculation to use `navBarCornerRadiusDp` instead of a hardcoded value. - Added a conditional check for `NavBarStyle.FULL_WIDTH` to bypass interpolation logic. - Applied the dynamic radius to `baseCollapsedRadius` when the navigation bar is visible.
Updates the `DualPlayerEngine` to correctly handle transient focus loss during player transitions and prevents the seek bar from jumping immediately after a user seek interaction. Also simplifies the wavy slider implementation. - Added `shouldResumeAfterTransientAudioFocusLoss` utility and associated unit tests to ensure playback only resumes if a player was actively playing or transitioning. - Modified `DualPlayerEngine` to use the new resume policy when handling `AUDIOFOCUS_LOSS_TRANSIENT`. - Updated `PlayerSeekBar` to maintain the user's target seek position until the player's progress is within a specific threshold or a timeout occurs. - Simplified `WavySliderExpressive` by removing the `FlatTrackExpressive` state, using `LinearWavyProgressIndicator` exclusively with dynamic gap sizing based on wave amplitude.
Enhances Google Cast playback reliability by implementing precise MIME type detection for Ogg/Opus/Vorbis streams and preventing seeks on unstable formats that may crash the receiver session. Optimizes local resource usage by lazily initializing auxiliary ExoPlayer instances. - Added `CastAudioMimeUtils` to handle codec detection and MIME normalization for Cast-supported formats. - Implemented `CastRemotePlaybackState` to accurately project remote `MediaStatus` into local playback states, including buffering and recoverable error handling. - Introduced seek-stability checks for Cast playback, blocking seek requests for unstable Ogg streams and notifying the user. - Refactored `DualPlayerEngine` to lazily initialize the auxiliary `ExoPlayer` instance, reducing memory overhead when crossfades/transitions are not in use. - Improved Cast session authorization in `MediaFileHttpServerService` to better support range requests from various LAN endpoints. - Added automatic Cast error recovery logic to end sessions gracefully when a stream becomes unrecoverable. - Optimized cold-start queue preparation in `MusicService` for large playlists. - Added localized strings for Cast seek limitations.
Introduces a byte-probing mechanism for ISO-BMFF containers to improve audio codec detection and implements a buffering watchdog to handle remote stalls. Refactors the transcode cache to support progressive streaming, decoupling encoder performance from client connection stability. - Added `IsoBmffAudioCodecDetector` to parse MP4 boxes for accurate MIME type identification (ALAC, AAC, AC3). - Refactored `MediaFileHttpServerService` to stream transcoded data progressively from growing temp files, replacing the `TeeOutputStream` implementation. - Implemented a remote buffering watchdog in `CastTransferStateHolder` with multi-stage recovery (status request, item reload, or local fallback). - Improved handling of HTTP Range requests during active transcoding to prevent Cast loading timeouts. - Refined ALAC/AAC identification by combining metadata hints, CSD-0 presence, and byte probing. - Added unit tests for ISO-BMFF codec detection.
Refactors `PlayerViewModel` to identify and reuse existing media items within the current playback queue, reducing unnecessary reloads. Significantly expands `GenreIconProvider` with a comprehensive localized keyword mapping system and additional iconography. Optimizes `PlaybackStatsRepository` performance through event caching and query constraints. - Added `resolveReusablePlaybackTargetIndex` to identify and seek to existing media items when the playback context matches. - Expanded `GenreIconProvider` with extensive internationalized support for dozens of genres across multiple languages (including Spanish, Portuguese, French, German, Japanese, Korean, and Chinese). - Implemented `cachedEvents` in `PlaybackStatsRepository` to minimize file I/O during statistics computation. - Introduced `MAX_SONG_STATS_COUNT` and conditional distribution logic to improve stats processing performance. - Updated `DualPlayerEngine` to notify player swap listeners when a transition is canceled while running. - Cleaned up playback cancellation logic into `cancelPendingDirectPlaybackBuild`.
Refactors how `predictiveBackCollapseProgress` affects sheet transformations by introducing an `effectiveFraction`. This unify expansion and back-gesture states, leading to cleaner interpolation logic for heights, corner radii, and paddings. - Introduced `effectiveFraction` calculation to combine `playerContentExpansionFraction` and `predictiveBackCollapseProgress`. - Simplified `playerContentAreaHeightPxProvider` and corner radius calculations using the unified fraction. - Removed edge-specific horizontal padding logic (`predictiveBackSwipeEdge`), making padding uniform during back gestures. - Set `currentBottomPadding` to a constant `0.dp`. - Removed unnecessary `currentSheetContentState` and `predictiveBackSwipeEdge` dependencies from various state providers.
Introduces the ability to set local audio files as system ringtones, notification sounds, or alarms directly from the `SongInfoBottomSheet`. This includes a new selection dialog, confirmation flow, and the necessary permission handling for modifying system settings. - Added `WRITE_SETTINGS` permission to `AndroidManifest.xml`. - Implemented `setSongAsTone` logic in `SongInfoBottomSheetViewModel` using `RingtoneManager` and `MediaStore` URI resolution. - Added `ToneTargetPickerDialog` and `ToneConfirmationDialog` composables to handle user selection and confirmation. - Integrated `ActivityResultLauncher` in `SongInfoBottomSheet` to request system settings write permissions when needed. - Updated the bottom sheet layout to include a new "Set as" action button alongside existing watch transfer options. - Added localized strings for several languages, including Indonesian, Russian, Norwegian, Korean, German, Chinese, French, Italian, and Spanish.
Replaces the millisecond-based `optimisticPosition` with a fraction-based `targetSeekFraction` to prevent the progress slider from snapping back after a seek operation. This aligns the synchronization logic with the `LyricsSheet` component, ensuring the slider thumb stays at the dropped position until the smooth playback progress catches up. - Replaced `optimisticPosition` with `targetSeekFraction` and `lastSeekFinishedTime`. - Migrated catch-up logic from a manual `while` loop to `snapshotFlow` for better reactivity. - Updated catch-up thresholds to 4% progress difference or a 5-second safety timeout. - Simplified `animatedProgressState` logic using a `when` block. - Ensured seek state is reset when the `songId` changes.
Updates the `MarqueeText` component to better handle overflow scenarios by adding a fade-out gradient effect and refining the scrolling logic. - Simplified the `canStart` derived state logic by removing the `canScroll` dependency. - Added a new layout block for overflowing text that applies a horizontal gradient fade to the right edge using `BlendMode.DstIn`. - Ensured `softWrap = false` is consistently applied to all text states. - Improved layout constraints by adding `fillMaxWidth()` to the marquee container and its internal text components.
Optimizes the progress rendering logic to prevent visual artifacts during significant state changes like track switching or resuming from the background. - Snaps progress immediately if the delta exceeds 10%, avoiding the "slow slide" effect during track changes or large seeks. - Caps the update interval to a maximum of 250ms to prevent excessive tweening when progress resumes after the app was backgrounded or paused. - Updated `lastProgressUpdateNanos` handling to ensure smooth transitions after snapping.
Updates `RecentlyPlayedSongUiModel` to support parcelization and utilizes `rememberSaveable` to ensure the recently played songs list is preserved across configuration changes and process death. - Added `@Parcelize` and `Parcelable` implementation to `RecentlyPlayedSongUiModel`. - Switched from `remember` to `rememberSaveable` for the `recentlyPlayedSongs` state in `HomeScreen`.
Introduces an `AnimatedVisibility` overlay that appears when the player sheet is expanded. This scrim provides a visual backdrop and allows users to collapse the `UnifiedPlayerSheetV2` by tapping the background area. - Added `isExpandedOrExpanding` state derived from the player expansion fraction. - Implemented a semi-transparent `Box` that covers the screen when the sheet is active. - Added `pointerInput` with `detectTapGestures` to trigger `collapsePlayerSheet()` on tap. - Applied fade-in and fade-out animations for the overlay transitions.
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.
Final tweaks before beta 7