49 Commits

Author SHA1 Message Date
dsn5ft
0697f6fe89 [Gradle] Enable non transitive R classes (resource namespacing) and fix errors
PiperOrigin-RevId: 738871402
2025-03-20 18:34:33 +00:00
rightnao
ca0b870a34 [Carousel] Recyclerview children do not inherit layout direction
PiperOrigin-RevId: 729275138
2025-02-25 19:27:40 +00:00
rightnao
52228c1b3b [Carousel] Update keyline state if necessary if item size changes
PiperOrigin-RevId: 719390625
2025-01-27 21:02:42 +00:00
rightnao
d0f5d721a1 [Carousel] Recalculate keyline state if it doesn't match the current container size
PiperOrigin-RevId: 718578581
2025-01-24 18:27:58 +00:00
rightnao
4bc4381e24 [Carousel] Added a notifyItemSizeChanged() method
PiperOrigin-RevId: 704836257
2024-12-16 13:00:43 +00:00
pubiqq
767f25aa49 [Docs] Fix javadoc links
Resolves https://github.com/material-components/material-components-android/pull/4333

GIT_ORIGIN_REV_ID=61739e430bcda13086b83015e4054d7e318cd0d5
PiperOrigin-RevId: 700775734
2024-12-02 20:07:07 +00:00
rightnao
6b263fa958 [Carousel] Fix carousel spamming view re-binding
PiperOrigin-RevId: 651470722
2024-07-22 18:22:04 +00:00
pubiqq
510881a469 [Internal] Stop using deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4117

GIT_ORIGIN_REV_ID=dd157e8360c2511810496693cec1616fce578655
PiperOrigin-RevId: 632284856
2024-05-13 17:37:38 +00:00
rightnao
8c541e6b25 [Carousel] Prevent scrolling if there's less items than focal keylines
PiperOrigin-RevId: 625466841
2024-04-17 18:04:41 +00:00
rightnao
9393b9779e [Carousel] Support unclipped padding for uncontained variant of carousel
PiperOrigin-RevId: 625101250
2024-04-16 17:52:05 +00:00
pekingme
46fa6465fe [Cleanup] Internal change
PiperOrigin-RevId: 608668937
2024-02-29 08:27:55 -08:00
Material Design Team
5471b8d37a Internal change
PiperOrigin-RevId: 607976596
2024-02-26 13:44:54 -08:00
rightnao
1ef42e2f23 [Carousel] Shift keylines in contained strategies when there exists padding, and clipToPadding=false
PiperOrigin-RevId: 595162372
2024-01-03 20:58:38 +00:00
hunterstich
e88a1b98d2 [Carousel] Added support for cross axis wrap_content RecyclerViews
PiperOrigin-RevId: 590637698
2023-12-14 15:45:23 +00:00
rightnao
92a5444de9 [Carousel] Add attributes to change small item size
PiperOrigin-RevId: 580249803
2023-11-08 15:13:51 +00:00
hunterstich
26c3129201 [Carousel] Fixed crash when recyclerview has a size of zero.
Resolves https://github.com/material-components/material-components-android/issues/3634

PiperOrigin-RevId: 573843130
2023-10-17 10:55:34 -07:00
rightnao
fb9c1c6edf [Carousel] When navigating with keyboard, scroll focused item to nearest focal keyline, not the first focal keyline
PiperOrigin-RevId: 573024609
2023-10-13 12:37:16 -07:00
rightnao
cbb380df61 [Carousel] Add logic for multibrowse strategy to change strategy when number of items is less than the number of keylines
Resolves https://github.com/material-components/material-components-android/issues/3598

PiperOrigin-RevId: 572078262
2023-10-10 10:46:28 -07:00
rightnao
d5d604d0cc [Carousel] Disallowing center aligned hero strategy with only 2 items since it does not make any sense. With only 2 items there can only be a start state and end state with the hero strategy.
Resolves https://github.com/material-components/material-components-android/issues/3589

PiperOrigin-RevId: 568965460
2023-10-02 13:36:53 +00:00
rightnao
8cb444b268 [Carousel] Fix issue with uncontained carousel not having a proper end scroll value due to assumption made in end scroll calculation
resolves https://github.com/material-components/material-components-android/issues/3599

PiperOrigin-RevId: 568948116
2023-10-02 13:36:19 +00:00
rightnao
4a6ae4d0b6 [Carousel] Update scroll offset to scroll to the estimated position that it was at upon an initial load
Resolves https://github.com/material-components/material-components-android/issues/3590

PiperOrigin-RevId: 568642330
2023-09-26 20:55:25 -04:00
pubiqq
4ce7e4c8fa [Carousel] Reduce the number of truncations in intermediate calculations
Resolves https://github.com/material-components/material-components-android/pull/3581
Resolves https://github.com/material-components/material-components-android/issues/3579

GIT_ORIGIN_REV_ID=1bcb42de0535edac134a6fc27dcb14b22f7dc1a5
PiperOrigin-RevId: 565653783
2023-09-15 17:25:17 -04:00
rightnao
3d84841cad [Carousel][A11y] Fix some a11y bugs in Carousel
PiperOrigin-RevId: 559881261
2023-08-25 17:51:59 +00:00
rightnao
9d81cac125 [Carousel] Add left-aligned uncontained strategy
PiperOrigin-RevId: 559197283
2023-08-23 19:28:53 +00:00
rightnao
966f7daec9 [Carousel] Fix orientation not correct in item decoration calculations
Resolves https://github.com/material-components/material-components-android/issues/3500

PiperOrigin-RevId: 558825973
2023-08-21 19:11:40 +00:00
rightnao
ff528621b3 [Carousel] Add a layout listener to recyclerview to refresh keyline state upon size change
PiperOrigin-RevId: 551280769
2023-07-27 22:50:16 +00:00
rightnao
547156e497 [Carousel] Add carousel alignment attribute
PiperOrigin-RevId: 548719675
2023-07-18 16:50:16 +00:00
rightnao
674ec44429 [Carousel] Fix issue with not refreshing keylines
PiperOrigin-RevId: 547956870
2023-07-17 15:58:09 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
rightnao
7822ef827b [Carousel] Add orientation helper to clean up CarouselLayoutManager orientation differences
PiperOrigin-RevId: 543813088
2023-06-27 19:17:07 +00:00
rightnao
6b48d3bb80 [Carousel] Add vertical scrolling capability
PiperOrigin-RevId: 542943240
2023-06-27 13:37:53 +00:00
rightnao
9486de5f2f [Carousel] Ensure that masks are pushed out beyond the parent bounds if they are _on_ the parent bounds
PiperOrigin-RevId: 540105089
2023-06-14 15:14:54 +00:00
rightnao
16c1575758 [Carousel] Carousel updates and fixes
- If item width is more than twice the item height, limit the width to twice the item height and add a medium item to the hero variant of the carousel.
- Fix snaphelper to snap to closest keyline state instead of always the default keyline state
- Add new KeylineStatePositionList to keep track of which keyline states to be in for each position. Update scrollToPosition methods to take the correct keyline instead of default keyline

PiperOrigin-RevId: 537955672
2023-06-06 15:56:43 +00:00
rightnao
7d6a977d50 [Carousel] Fix contained mask logic to only update masks when it is still in view, and remove restrictions on mask size with childWidth/2F. The only restriction is that the right of the mask must be greater than the left of the mask.
PiperOrigin-RevId: 537080963
2023-06-05 18:42:52 +00:00
hunterstich
85b6d5018d [Carousel] Fixed multi browse strategy clipping extra small items before being fully collapsed
This moves mask rect calculation from MaskableFrameLayout into CarouselLayoutManager so CarouselLayoutManager can change the offsetting of the mask inside a child and clip according to both the keylines and the carousel container boundary.

PiperOrigin-RevId: 533082558
2023-05-22 18:34:32 +00:00
rightnao
340cd44b07 [Carousel] Add Hero carousel strategy
PiperOrigin-RevId: 531247503
2023-05-11 19:14:21 +00:00
rightnao
8938da8c28 [Carousel] Add CarouselSnapHelper
PiperOrigin-RevId: 529457461
2023-05-04 17:00:56 -04:00
hunterstich
9d0732be9e [Carousel] Fixed child index bug causing items to be ordered incorrectly.
When filling the RecyclerView, views need to be added at the correct index (either begginning or end) depending on the direction of fill.

PiperOrigin-RevId: 513510079
2023-03-03 16:25:30 +00:00
hunterstich
6166e73d36 [Carousel] Implemented smoothScrollToPosition
PiperOrigin-RevId: 509873609
2023-02-17 04:32:27 -08:00
hunterstich
220415d3c1 [Carousel] Fixed scroll offset calculation error when last focal keyline comes after the last child
Calculating end scroll offset was using the distance between the last child and the last focal keyline. When the last child came before the last keyline, an unexpected scroll offset was returned. This also adds a dropdown to the catalog demo to allow setting the number of items in the carousel.

PiperOrigin-RevId: 508739119
2023-02-10 22:52:03 +00:00
hunterstich
fc0f53a0cd [Carousel] Renamed CarouselConfiguration to CarouselStrategy.
PiperOrigin-RevId: 508619540
2023-02-10 14:24:39 +00:00
hunterstich
85c006b1d2 [Carousel] Updated CarouselConfiguration visibility and improved documentation
PiperOrigin-RevId: 508401214
2023-02-09 18:27:27 +00:00
hunterstich
8014267740 [Carousel] Changed CarouselConfiguration to have an empty constructor and pass Carousel in through onFirstChildMeasuredWithMargins
PiperOrigin-RevId: 508389752
2023-02-09 18:25:29 +00:00
hunterstich
67b251af32 [Carousel] Improve documentation and throw when CarouselLayoutManager children are not Maskable.
PiperOrigin-RevId: 508160107
2023-02-09 13:51:34 +00:00
hunterstich
e32e625e14 [Carousel] Updated to support MaterialDivider and helper for getting the bounds of a masked item from the layout manager.
PiperOrigin-RevId: 507612229
2023-02-07 22:11:57 +00:00
hunterstich
1a25706f3a [Carousel] Fixed explore by touch causeing list to scroll
PiperOrigin-RevId: 506701246
2023-02-03 21:01:00 +00:00
hunterstich
ff48bc5e3b [Carousel] Removed CenteredCarouselConfiguration.
This removes CenteredCarouselConfigration and its superclass MultibrowseCarouselConfiguration and renames StartCarouselConfiguration to MultiBrowseCarouselConfiguration.

PiperOrigin-RevId: 506424085
2023-02-01 22:32:20 +00:00
hunterstich
0f179b38e9 [Carousel] Add a11y focus scrolling support
PiperOrigin-RevId: 505783943
2023-01-31 19:51:12 +00:00
hunterstich
4ecba81de6 [Carousel] Release carousel component
PiperOrigin-RevId: 501635363
2023-01-12 12:25:52 -08:00