778 Commits

Author SHA1 Message Date
manabu-nakamura
4e1b130cdf [Catalog][Carousel] Fixed demos in RTL
Resolves https://github.com/material-components/material-components-android/pull/3556

GIT_ORIGIN_REV_ID=c2fbf22cfe914840783f41145171defffe9ad738
PiperOrigin-RevId: 564361017
2023-09-12 10:45:07 -04:00
manabu-nakamura
79a19537d7 [Catalog] Make side sheet demo icon easier to see in dark mode
Resolves https://github.com/material-components/material-components-android/pull/3566
Resolves https://github.com/material-components/material-components-android/issues/3565

GIT_ORIGIN_REV_ID=5dcb14696ab6bbfd2d8a34927acb13a239598195
PiperOrigin-RevId: 563822545
2023-09-08 16:10:09 -04:00
leticiars
c40e468820 [Catalog][TopAppBar] Remove edge-to-edge to top app bar demos due to glitches in ActionBar demo
Automated g4 rollback of changelist 560774617

PiperOrigin-RevId: 561719046
2023-08-31 15:10:18 -04:00
pekingme
4e995d1f81 [TopAppBar] Added liftOnScroll and lifted toggles to the catalog.
PiperOrigin-RevId: 561137677
2023-08-30 15:25:23 -04:00
manabu-nakamura
480bbc6a9b [Catalog][Carousel] Update slider position when carousel is scrolled in uncontained carousel demo
Resolves https://github.com/material-components/material-components-android/pull/3539

GIT_ORIGIN_REV_ID=c520f2f5fa88a9c08e65e9d3e34db075fdb938dd
PiperOrigin-RevId: 560815648
2023-08-29 15:19:03 -04:00
manabu-nakamura
aa5b5bc157 [Catalog][TopAppBar] Applied edge-to-edge to top app bar demos
Resolves https://github.com/material-components/material-components-android/pull/3548
Resolves https://github.com/material-components/material-components-android/issues/3547

GIT_ORIGIN_REV_ID=22425cde55ee6e99c2b679c9ecdca8bba745d4b9
PiperOrigin-RevId: 560774617
2023-08-28 14:56:53 -04:00
rightnao
3d84841cad [Carousel][A11y] Fix some a11y bugs in Carousel
PiperOrigin-RevId: 559881261
2023-08-25 17:51:59 +00:00
pfthomas
5f1cab65b1 [MaterialDatePicker] Fix header layout overlapping
PiperOrigin-RevId: 559538381
2023-08-24 20:50:49 +00:00
rightnao
ef9f91864f [Catalog][Carousel] Add uncontained carousel demo to catalog
PiperOrigin-RevId: 559221323
2023-08-23 19:32:06 +00:00
manabu-nakamura
3652fde271 [Catalog][Carousel] Update slider position when carousel is scrolled in catalog demos
Resolves https://github.com/material-components/material-components-android/pull/3521
Resolves https://github.com/material-components/material-components-android/issues/3520

GIT_ORIGIN_REV_ID=f26a8b55c9026a3418024a2e51ba3570a017c59d
PiperOrigin-RevId: 558934224
2023-08-22 00:13:28 +00:00
manabu-nakamura
6c2dd5d69e [Catalog] Applied edge-to-edge to bottom sheet in Carousel demo
Resolves https://github.com/material-components/material-components-android/pull/3505
Resolves https://github.com/material-components/material-components-android/issues/3504

GIT_ORIGIN_REV_ID=7bdf0989eac11e9b496dd38e9e6fda8acae3b593
PiperOrigin-RevId: 555208372
2023-08-09 17:43:01 +00:00
rightnao
af7d09a43d [Catalog] Fix fullscreen vertical carousel to use vertical dividers
resolves https://github.com/material-components/material-components-android/issues/3500

PiperOrigin-RevId: 554496440
2023-08-09 15:51:22 +00:00
rightnao
0171624c16 [Carousel][Catalog] Remove default list from Carousel catalog demos as it is not an example of a carousel
PiperOrigin-RevId: 551280479
2023-07-27 22:49:17 +00:00
pfthomas
db9a6412ec [MaterialSwitch] Amendments to thumb icon size support
Resolves https://github.com/material-components/material-components-android/pull/3364

PiperOrigin-RevId: 549627031
2023-07-20 22:17:48 +00:00
rightnao
7cfd30f99b [Catalog][Carousel] Add alignment option to hero carousel
PiperOrigin-RevId: 548725196
2023-07-18 16:51:24 +00:00
rightnao
ad6afbf6d8 [Carousel][Catalog] Add fullscreen demo to catalog
PiperOrigin-RevId: 544700979
2023-07-05 13:40:20 +00:00
rightnao
27abfdba4f [Badge] Deprecate bottom badge gravities and update docs and usages in catalog
PiperOrigin-RevId: 543527285
2023-06-27 18:55:22 +00:00
afohrman
f2e70d2d66 [Android U] Replaced BuildCompat#isAtLeastU() method calls with explicit SDK checks for UPSIDE_DOWN_CAKE.
Before 1.12.0-alpha01 which was released on 6/7, BuildCompat#isAtLeastU() only returns true if API level is greater than 33 and the version running is a pre-release. Two things happened on 6/7 -- the version became a "platform stable" version, and core library version 1.12.0-alpha01 was released, which changes BuildCompat#isAtLeastU() to return true if the version is 34 and stable.

PiperOrigin-RevId: 540304068
2023-06-14 12:45:51 -07:00
hunterstich
a67a885668 [Predictive Back] Update components to use BackEventCompat
Clients should prefer listening to back events using androidx.activity.OnBackPressedCallback which has been updated to forward BackEventCompat objects in androidx.activity:activity:1.8.0-alpha05. This updates component predictive back APIs to take in BackEventCompat objects instead of android.window.BackEvent objects to simplify usage - getting rid of the need for version checks and object conversions.

PiperOrigin-RevId: 540290323
2023-06-14 12:44:53 -07:00
pfthomas
022e217770 [Navigation] Add itemTextAppearanceActiveBoldEnabled attr
Resolves https://github.com/material-components/material-components-android/issues/3191
Resolves https://github.com/material-components/material-components-android/issues/3293

PiperOrigin-RevId: 539977391
2023-06-14 15:14:24 +00:00
Material Design Team
2336c23fab [Build] Update to compileSdkVersion 34 and update catalog to use androidx.activity:activity:1.8.0-alpha05
PiperOrigin-RevId: 539031943
2023-06-09 08:02:47 -07:00
afohrman
7a3f30b065 [Side Sheet] Aligned close affordance and title text along the baseline rather than the top.
The close affordance icon and title text were previously aligned by the top. Since the icon button has extra spacing from insets and padding, the Views appeared to be misaligned. Aligning along the baseline fixes the visual misalignment.

This change is in the catalog since the side sheet view is provided by the developer.

PiperOrigin-RevId: 538570382
2023-06-09 08:01:54 -07:00
afohrman
7ee0b72e8a [Side Sheet] Mapped close affordance to ?attr/colorOnSurfaceVariant in catalog.
PiperOrigin-RevId: 538533345
2023-06-09 08:01:15 -07:00
Material Design Team
836c51e44a [M3][Color] Fix harmonization demo bug
PiperOrigin-RevId: 538259732
2023-06-06 20:02:18 +00:00
afohrman
690cd5d695 [Side Sheet] Changed side sheet child containers in Catalog from LinearLayouts to FrameLayouts.
The LinearLayouts each contained only one child, so a FrameLayout is a better choice; more lightweight and slightly more performant. This is a visual no-op.

PiperOrigin-RevId: 532823326
2023-05-22 18:32:29 +00:00
afohrman
a0d4fa03ff [Side Sheet] Changed side sheet title text appearance to Title Large.
This change is in the Catalog, since the developer is responsible for layout elements within the side sheet.

Also changed some other elements of the side sheet content layouts to balance out the visual look of the sheets.

PiperOrigin-RevId: 532788247
2023-05-22 18:31:42 +00:00
rightnao
b57dae57aa [Carousel] Add Carousel Hero strategy demo
PiperOrigin-RevId: 531612383
2023-05-15 17:29:00 +00:00
rightnao
26c377962f [Carousel][Catalog] Add option for snapping with multi-browse carousel demo
PiperOrigin-RevId: 529818471
2023-05-08 14:48:58 -04:00
afohrman
87a45a2a3d [Side Sheet] Fixed modal sheet text field formatting bug in catalog.
Before this change, the modal sheet is initially expanded with a "%f" for the slide offset text and the state TextView doesn't change until the first drag of the sheet.

There was actually no underlying side sheet bug here; the modal sheet has two ways of animating, window animations and the "native" SideSheetBehavior ViewDragHelper animations. In the catalog, the modal sheet's text views weren't getting set yet because it was using the window animations to enter/exit and the callback doesn't run until it's dragged with SideSheetBehavior's ViewDragHelper. The only change necessary here is to set the TextViews to Visibility#GONE until the callback runs, so that there are no uninitialized TextViews visible on screen.

Resolves https://github.com/material-components/material-components-android/issues/3167.

PiperOrigin-RevId: 529220073
2023-05-04 07:41:27 -07:00
afohrman
b984e64445 [Predictive Back] [Side Sheet] Added handleBackInvoked() predictive back support for coplanar side sheets.
Added an AnimatorUpdateListener that runs in finishBackProgress() to make the coplanar sibling's margins update as the sheet slides back to its origin edge.

PiperOrigin-RevId: 527749916
2023-04-28 14:46:43 -04:00
dsn5ft
d8c5c2c87d [Predictive Back] Fix custom nav drawer Catalog demo pre-T crash due to OnBackAnimationCallback class not found
PiperOrigin-RevId: 527348628
2023-04-26 16:23:49 -04:00
afohrman
562285e051 [Predictive Back][Side Sheet] Added predictive back support for standard side sheets.
PiperOrigin-RevId: 527326750
2023-04-26 16:20:46 -04:00
pfthomas
29b59c21f5 [MaterialDatePicker] Add getTextColor to DayViewDecorator
PiperOrigin-RevId: 527265648
2023-04-26 16:19:16 -04:00
afohrman
d0ad45e1a1 [Side Sheet] Added left/start modal sheet.
Sheet gravity is intended to be set once at setup before the sheet is shown; sheet gravity changes are not supported at runtime and will cause an IllegalStateException.

Also refactored modal sheet demo to recreate the sheet every time it's shown, which allows the sheet gravity changes to take effect for modal sheets.

PiperOrigin-RevId: 526957847
2023-04-25 17:07:13 -04:00
raajkumars
3b43d41f16 [M3][Catalog][Search] Updated SearchDemoUtils to mark the class and methods as public so that it can be resued.
PiperOrigin-RevId: 525549879
2023-04-24 15:25:09 -04:00
dsn5ft
9405121f62 [Predictive Back] Update side container back helper to support containers with arbitrary child views
PiperOrigin-RevId: 525466973
2023-04-19 14:12:04 -07:00
rightnao
add7f5d650 [TabLayout] Create tab demo fragment that uses viewpager2 in Catalog
PiperOrigin-RevId: 524914935
2023-04-19 12:44:06 -07:00
hunterstich
0184b5baa9 [Carousel] Updated MultiBrowseCarouselStrategy to find best arrangments using a cost function
This changes the way arrangements are found by:
* Finding all possible arrangements of items
* Sort the arrangement candidates using a cost function that optimizes for total space fit, large item size retention, and adherence to other input params
* Fit and use the top arrangement to work within the carousel's available space

PiperOrigin-RevId: 522568015
2023-04-10 15:03:52 +00:00
pekingme
6b28ffc664 [BottomSheet] Internal cleanup.
PiperOrigin-RevId: 522410409
2023-04-10 14:53:45 +00:00
hunterstich
5bc7a50b35 [Carousel] Fixed mutli-browse catalog demo crashing due to invalid position slider values.
PiperOrigin-RevId: 522072959
2023-04-10 14:48:34 +00:00
dsn5ft
2c23d2a158 [Predictive Back][Bottom Sheet] Fix bug where standard hideable bottom sheets don't stay hidden after predictive back
It wasn't an issue for modal bottom sheets because they dismiss the whole window when the bottom sheet behavior is hidden

Also updated Bottom App Bar demo drawer to opt into predictive back, which is a standard hideable bottom sheet

PiperOrigin-RevId: 520312905
2023-03-29 19:16:12 +00:00
dsn5ft
d6fad952c6 [Predictive Back][Bottom Sheet] Update Bottom Sheet to support predictive back
- Enable predictive back by default for Bottom Sheet dialogs
- Update Catalog demo to enable predictive back for persistent/standard bottom sheet

PiperOrigin-RevId: 518896205
2023-03-23 18:15:27 +00:00
Material Design Team
2aa1cf3198 [M3][Color] Color Component demo update
PiperOrigin-RevId: 518320238
2023-03-21 20:49:20 +00:00
afohrman
78fa15748f [Side Sheet] Added LeftSheetDelegate and left sheet support for standard and coplanar side sheets.
Standard and coplanar side sheets now support sliding and dragging from the left side, as well as automatic RTL mirroring when `layout_gravity` is set to `start` or `end`. Change the sheet edge by setting `layout_gravity` on the side sheet view in XML or programmatically.

PiperOrigin-RevId: 518048965
2023-03-20 21:25:55 +00:00
Material Design Team
c786582d6a [M3][Color] Color Component demo update
PiperOrigin-RevId: 517511129
2023-03-20 21:23:50 +00:00
dsn5ft
2c297faf4b [Predictive Back][Navigation Drawer] Infrastructure for back handling in components + Navigation Drawer predictive back support
- Added MaterialBackHandler interface and MaterialBackOrchestrator class
- Implemented animations in MaterialSideContainerBackHelper for NavigationView when DrawerLayout parent

PiperOrigin-RevId: 517399606
2023-03-20 21:10:22 +00:00
dsn5ft
22c4e0dd60 [Predictive Back] Migrate Catalog to use AndroidX back pressed callbacks and enable predictive back-to-home
PiperOrigin-RevId: 515136472
2023-03-13 21:16:16 +00:00
rightnao
c22eb0d31b [BottomAppBar][Catalog] Fix bug with transparent top app bar when in bottom app bar layout
resolves https://github.com/material-components/material-components-android/issues/3265

PiperOrigin-RevId: 515043402
2023-03-08 21:29:38 +00: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
4c3e1d513b [Transitions] Fixed catalog errors for some demos.
* Music player controls expands to take the place of the title area by updating constraints to tie both view groups to the bottom of the album art.
* Fixed container transform activity scrolling bug caused by window.setSharedElementsUseOverlay. Removed this as it has no effect on the demo.
* Fixed shared axis fragment end layout not animating by setting the end fragments transition name on the root scroll view instead of the scroll view's inner layout
* Added insets to shared axis controls to be visible above the navigation bar when in edge-to-edge mode

Resolves https://github.com/material-components/material-components-android/issues/3247

PiperOrigin-RevId: 511764274
2023-02-23 06:06:26 -08:00