-
-
Notifications
You must be signed in to change notification settings - Fork 9
player: Add Player Animations
#106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ericgacoki
wants to merge
14
commits into
main
Choose a base branch
from
feature/anim-player-sheet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
This introduces a new, animated bottom sheet player that replaces the previous mini-player and `NowPlayingScreen`. - **`AnimatedPlayerSheet.kt`**: A new composable for the player UI, which transitions smoothly from a mini-player to a full-screen player with animations for the artwork, controls, and background. - **Queue Sheet**: A secondary, draggable sheet for the track queue, accessible from the expanded player. - **`MainActivityWithAnimatedPlayer.kt`**: A new entry point activity that integrates the `AnimatedPlayerSheet`. The bottom navigation bar now animates out of view as the player sheet expands. - **Updated `AndroidManifest.xml`**: Sets `MainActivityWithAnimatedPlayer` as the launcher activity. - **Horizontal Swiping**: The collapsed mini-player now supports horizontal swiping to skip to the next or previous track.
This commit refactors the `AnimatedPlayerSheet` to unify the collapsed and expanded layouts into a single, cohesive structure. Key changes: - Replaced the separate `AsyncImage` and `HorizontalPager` with a single `HorizontalPager` that animates its size and position. - Combined the mini-player's title and controls with the pager into a single `Row` for a smoother transition. - Simplified the logic for showing and hiding components during the sheet's expansion and collapse animation. - Improved the image scaling and corner radius animations for a cleaner visual effect. - Adjusted the threshold for showing the collapsed progress bar to improve the UI during transitions.
- Make the mini player visible again when the queue sheet is nearly fully expanded, improving navigation context. - Enable opening the queue sheet by clicking the queue icon, in addition to dragging. - Relocate the drag gesture for the queue sheet to the bitrate badge area for a more intuitive user experience. - Improve drag responsiveness by adding a multiplier. - Ensure the blurred background is always visible when the player sheet is not fully collapsed. - Load the original size for the track's cover art to improve image quality. - Refine the visibility animation for the collapsed progress bar.
- Implement a `BackHandler` to manage the behavior of the back button. - If the queue sheet is open, the back press will now close it. - If the primary player sheet is expanded, the back press will collapse it to the partial state.
- Add a track options bottom sheet to the player queue, allowing actions like "Go to Artist," "Go to Album," "Play Next," and toggling favorites. - Display the current queue source (e.g., Album, Artist, Folder) with a clickable link to navigate to it. - Refactor player navigation by introducing a `CommonNavigator` to handle actions like navigating to artist or album pages. - Enable the animation on the sound signal bars in the queue's currently playing track item.
- Lock `MainActivityWithAnimatedPlayer` to portrait mode in the AndroidManifest. - Prevent the "Empty" message from showing in the folder/track list when a loading error occurs.
- Introduce animated vector drawables (AVDs) for the bottom navigation icons: Folder, Album, Artist, and Search. - Implement animations that trigger on icon click, providing visual feedback to the user. - Add the `androidx.compose.animation:animation-graphics` dependency to support animated icons in Compose. - Update the bottom navigation bar in `MainActivityWithAnimatedPlayer` to use the new animated icons.
- Add animated vector drawables (AVDs) for the play/pause, next, and previous buttons. - Implement `AnimatedImageVector` in the player screen to provide visual feedback when playback controls are used. - Add a rotation animation to the existing artist icon AVD.
- Add a new `animated-vector` drawable (`avd_heart.xml`) that defines a heartbeat-like scaling animation. - Add another `animated-vector` drawable (`avd_heart_fill.xml`) for animating the transition between an outline and a filled heart. - Implement a heart bounce and crossfade animation on the favorite icon in the `CustomTrackBottomSheet`. - Apply the same heart bounce and crossfade animation to the favorite icon in the full `AnimatedPlayerSheet`.
The `LaunchedEffect` in `FoldersAndTracks.kt` is updated to re-trigger when `gotoFolderName` or `gotoFolderPath` changes, instead of only running once. This ensures that navigation logic for a "go to folder" action is correctly executed whenever the target folder changes.
- Implement `NestedScrollConnection` in `AnimatedPlayerSheet` to allow dragging the sheet down from the top of the queue list. - Deprecate the legacy `MainActivity`, `NowPlayingScreen`, and `QueueScreen` in favor of the new `AnimatedPlayerSheet`. - Adjust the queue sheet drag response by reducing the drag multiplier. - Refine animations by changing the queue opacity to reach its maximum at 80% of the drag progress. - Ensure the queue list scrolls to the currently playing track only once per session when opened. - Add `application.backup` to `.gitignore`.
- Reset player UI state when the queue is cleared, ensuring a clean slate by nullifying the current track, resetting positions, and setting the playback state to `PAUSED`. - The player sheet now hides completely (`peekHeight = 0.dp`) when no track is playing and automatically expands when a track is added to the queue. - Implement logic to clear the queue by swiping the player sheet down to its hidden state. - Refine the sheet expansion progress calculation by capturing the initial offset only after the sheet has settled, leading to more reliable animations.
- Implement a long-press gesture on the collapsed player bar to enable closing the player. A haptic feedback confirms activation, after which a downward drag will hide the sheet. - Refactor the player bar's gesture handling to reliably distinguish between taps (to expand), horizontal swipes (for prev/next), and the new long-press-to-close gesture. - Remove haptic feedback logic from the `MediaControllerViewModel`, moving it to the UI layer within the long-press gesture. - Refine the sheet's corner radius animation to use an exponent, making it flatten more quickly only as it nears full expansion.
Minification (`isMinifyEnabled = false`) is disabled for all library modules (`core`, `database`, `network`, `uicomponent`, and all `feature/*` modules) in their release build configurations. This addresses issues with Hilt's annotation processing, which requires access to unobfuscated class names (like DAOs) from the app module. The final APK's code will still be minified by the app module's R8 process.
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.
Kapture.2025-12-23.at.01.00.00.mp4
Core Feature
Player Interactions
Animations
Polish