Merged
Conversation
This commit introduces a new feature that allows users to customize the album carousel's appearance in the music player. It also refactors the carousel implementation to be more robust and visually consistent across different devices. Key changes: - Added a new setting in "Appearance" to select the carousel style: "No Peek," "One Peek," or "Two Peeks." - The selected style is saved to user preferences using DataStore and exposed via the `PlayerViewModel`. - The `AlbumCarouselSection` now uses `BoxWithConstraints` to dynamically adjust its layout based on the selected style, ensuring the correct peek behavior and a 1:1 aspect ratio for the focused album art. - The carousel's height is now dynamically calculated to match the item width, maintaining a consistent square look for the album art. - The settings UI in `SettingsScreen.kt` has been updated with a new dropdown menu for the carousel style. - The `UserPreferencesRepository` and `SettingsViewModel` have been updated to support the new preference.
This commit fixes several visual bugs in the album carousel's different layout styles. The previous implementation had issues with aspect ratio, item alignment, and peeking behavior, especially at the edges of the playlist. The following fixes have been implemented: - Refactored `RoundedHorizontalMultiBrowseCarousel` to use dedicated keyline-generating functions for each style (`noPeekKeylineList`, `onePeekKeylineList`, `twoPeekKeylineList`). - The "No Peek" style now correctly enforces a 1:1 aspect ratio, ensuring the album art is always square. - The "One Peek" style has been corrected to prevent visual distortion of the first item in the queue and to remove the "extra peek" artifact. - The "Two Peeks" style now correctly centers the current item and displays the previous and next items on either side, fixing the incorrect `[current, next, next+1]` layout. - Removed the old, complex `multiBrowseKeylineList` function and its unused `Arrangement` helper class, simplifying the component's logic. - The `AlbumCarouselSection` now correctly calculates the carousel's height based on the available width and selected style to enforce the 1:1 aspect ratio for the main item.
This commit fixes several visual bugs in the album carousel's different layout styles by making targeted adjustments to the existing keyline generation logic. The previous implementation had issues with aspect ratio, item alignment, and peeking behavior. The following fixes have been implemented: - Refactored `multiBrowseKeylineList` to accept more flexible parameters for item counts and alignment. - Updated `RoundedHorizontalMultiBrowseCarousel` to use a `when` statement that calls the refactored keyline function with specific arguments for each `carouselStyle`: - **No Peek:** Configured to show a single, centered item. - **One Peek:** Configured for start-alignment to show one large item and a single peeking item. - **Two Peeks:** Configured for center-alignment with two smaller items to correctly show previous and next items. - Correctly enforced a 1:1 aspect ratio for the main album art in all modes by adjusting the carousel's container height in `AlbumCarouselSection`. - Preserved the carousel's core animation logic while ensuring the layouts are now visually correct and robust, especially at the edges of the playlist.
This commit addresses a visual glitch in the album carousel's "One Peek" mode where a 1-pixel sliver of a second item was visible. The fix involves making the layout calculation for this specific style more explicit. By setting `largeCounts` to `[1]`, `mediumCounts` to `[0]`, and `smallCounts` to `[1]`, the keyline arrangement is now strictly constrained to one large (focal) item and one small (peeking) item. This prevents the layout engine from attempting to render any additional items, thus removing the hairline artifact and ensuring the visual presentation is clean and correct as per the design requirement.
This commit resolves all outstanding visual bugs related to the album carousel's different layout styles, ensuring a polished and correct user experience. Key fixes include: - **One Peek Mode:** The hairline artifact caused by an extra off-screen item has been definitively fixed by setting `maxNonFocalVisibleItemCount` to `1` for this specific style. - **No Peek Mode:** User scrolling is now disabled in this mode, as the entire item is visible. The 1:1 aspect ratio is also correctly enforced. - **Two Peeks Mode:** The layout calculation has been corrected to properly display the previous and next items, centered correctly. - The implementation now dynamically adjusts `maxNonFocalVisibleItemCount` based on the selected `carouselStyle`, providing a robust solution that prevents extra items from being composed.
This commit fixes a persistent visual glitch in the album carousel's "One Peek" mode where a 1-pixel sliver of an unwanted third item was visible. Previous attempts to fix this by adjusting layout calculations were unsuccessful. This solution implements the user's suggestion of controlling the item's alpha directly. The `carouselItem` modifier now checks if the current style is "one_peek". If it is, it sets the `alpha` of any item with an index greater than `currentPage + 1` to `0f`, making it completely invisible. This robustly solves the hairline issue without affecting the layout of other styles.
This commit resolves a visual glitch in the album carousel's "One Peek" mode where a 1-pixel sliver of an unwanted item was visible. Based on user feedback, this fix replaces a hard-coded alpha change with a smooth animation. The `carouselItem` modifier now uses `animateFloatAsState` to animate the alpha of any item beyond the intended single peek from 1f to 0f. This change ensures: - The unwanted item is made completely invisible, removing the hairline artifact. - The transition is smooth and gradual as the user swipes, preventing any jarring visual changes. - The fix is targeted specifically to the "One Peek" style and does not affect other carousel modes.
This commit addresses an issue with the carousel's styling options and introduces a new icon. - **Carousel Style Logic:** The `RoundedParallaxCarousell.kt` has been updated to correctly handle the `CarouselStyle` enum. The previously commented-out `when` block, which caused all styles to default to `ONE_PEEK`, has been removed, restoring the intended `NO_PEEK`, `ONE_PEEK`, and `TWO_PEEK` behaviors. - **New Icon:** Adds the `rounded_view_carousel_24` drawable, which will be used for selecting the carousel style in the settings.
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.