188 Commits

Author SHA1 Message Date
pekingme
28cc2441d0 [Tokens] Updated to version 2.3.4.
PiperOrigin-RevId: 610835532
2024-02-29 08:36:02 -08:00
pekingme
ee7b4bddb4 [Tokens] Added formatting to break long lines and differentiate different comments.
PiperOrigin-RevId: 605684816
2024-02-12 18:03:59 +00:00
Material Design Team
8a71e7741a [AppBarLayout] Use an accessibility delegate to add and perform actions
This replaces the use of `ViewCompat#add/removeAccessibilityAction`

Both are valid strategies, but each call to `remove` or `add` triggers an accessibility event. Since this check is done in layout (originally to fix a11y scroll state) it's sending a high number of events that create noise for accessibility services.

To avoid this, we move this code to the delegate `onInitialize` and `performAction` methods. Instead of the view dynamically adding and removing actions to itself, the node is initialized with actions only when an a11y service sends a request with a new node (likely due to some UI change).

The flow here would look like:
1. UI is scrolled/page is loaded
2. TalkBack gets a scroll event/content change event
3. TalkBack requests new snapshot of the screen
4. ABL populates the node with the actions

For a simple scroll, this change reduces the events from ~40 to ~10.

We also add the Truth library for clearer assertions.

PiperOrigin-RevId: 605333170
2024-02-12 16:14:44 +00:00
pekingme
89212044a9 [Tokens] Updated to v0.213.
PiperOrigin-RevId: 603749766
2024-02-06 14:30:16 +00:00
pekingme
08d7ded67b [Tokens] Upgraded to v0.207.
PiperOrigin-RevId: 600947836
2024-01-24 21:05:53 +00:00
pekingme
4ccaaaa31d [Tokens] Upgraded to v0.203
PiperOrigin-RevId: 579928128
2023-11-08 15:12:21 +00:00
pekingme
637362d597 [Tokens] Upgraded to v0.195
PiperOrigin-RevId: 579905417
2023-11-06 20:27:15 +00:00
pekingme
0463c507d7 [Tokens] Upgraded to v0.185
PiperOrigin-RevId: 579904837
2023-11-06 20:26:18 +00:00
hunterstich
2ac8c1cbf6 [TopAppBar] Fixed compress effect clipping on API 21-24
Partially resolves https://github.com/material-components/material-components-android/issues/3603

PiperOrigin-RevId: 576102714
2023-10-26 20:37:38 +00:00
pekingme
bfee8a74d7 [Tokens] Upgraded to v0.175.
PiperOrigin-RevId: 572648883
2023-10-12 11:04:28 -07:00
pekingme
1e9f5f0730 [AppBarLayout] Simplified logics to animate the container color between lifted state and the default state.
PiperOrigin-RevId: 566754407
2023-09-20 12:30:16 +00:00
dsn5ft
c4ae01a5a5 [AppBarLayout] Fix dynamic status bar foreground lift on scroll color when using Tonal Surface Color on API Level 33
Resolves https://github.com/material-components/material-components-android/issues/3530
Resolves https://github.com/material-components/material-components-android/issues/3585

PiperOrigin-RevId: 566609767
2023-09-19 20:28:23 +00:00
dsn5ft
5f2b4b2531 [CollapsingToolbarLayout] Fixed title collapse fade mode color to use a Tonal Surface role instead of elevation overlay
Resolves https://github.com/material-components/material-components-android/issues/3525

PiperOrigin-RevId: 564678269
2023-09-12 10:48:57 -04:00
dsn5ft
569ddac527 [AppBarLayout] Fix dynamic status bar foreground lift on scroll color when using Tonal Surface Color
Resolves https://github.com/material-components/material-components-android/issues/3530

PiperOrigin-RevId: 564364138
2023-09-12 10:47:09 -04:00
pekingme
43242f20de [TopAppBar] Fixed that liftOnScrollColor doesn't respect to setLifted when liftOnScroll is set to false.
Resolves https://github.com/material-components/material-components-android/issues/3523

PiperOrigin-RevId: 563829477
2023-09-08 16:10:50 -04:00
pubiqq
0663019f45 [Color] Add ColorStateListDrawable support
Resolves https://github.com/material-components/material-components-android/pull/3538

GIT_ORIGIN_REV_ID=1bf9e320dc148e1bc959e7577372d3a393f35574
PiperOrigin-RevId: 563258432
2023-09-07 12:37:54 +00:00
pekingme
b5d6f1ae45 [ActionBar] Removed layered drawable for the background after tonal surface color.
PiperOrigin-RevId: 563179427
2023-09-07 12:37:18 +00:00
pekingme
8204856dd4 [Token][Color] Upgraded to v0.170 for tonal surface colors.
PiperOrigin-RevId: 555230534
2023-08-09 19:03:25 +00:00
pekingme
c7a0adf8dd [AppBarLayout] Added getMaterialShapeBackground() to return a MaterialShapeDrawable object of the background (non-lifted layer).
PiperOrigin-RevId: 553531357
2023-08-04 01:04:40 +00:00
pekingme
2b476b3a96 [TopAppBar] Updated the handling of liftOnScrollColor not override android:background.
PiperOrigin-RevId: 547883467
2023-07-17 15:56:54 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
pekingme
6980c40f12 [TopAppBar] Updated to take a CSL as the AppBarLayout background color.
PiperOrigin-RevId: 527090028
2023-04-26 16:18:09 -04:00
rightnao
fdaff78506 [TopAppBar] Removing keyboard scroll event workaround for AppBarLayout since CoordinatorLayout issue has been fixed in androidx.core:core:1.10.0
Resolves https://github.com/material-components/material-components-android/issues/2249

PiperOrigin-RevId: 525775019
2023-04-24 15:29:47 -04:00
pekingme
d722a782bc [Tokens] Upgraded outdated token output in textfield & appbar.
PiperOrigin-RevId: 520714140
2023-03-30 21:58:22 +00:00
pekingme
b3f7b6604e [AppBarLayout] Fixed dragging the app bar layout overshoots the status bar.
Resolves https://github.com/material-components/material-components-android/issues/3316

PiperOrigin-RevId: 520466126
2023-03-30 15:55:50 +00:00
pekingme
dfbf4d9c2c [Cleanup] Minor fix.
PiperOrigin-RevId: 519997026
2023-03-28 16:19:46 +00:00
rightnao
21a7aff545 [AppBarLayout] Fix bug in AppBarLayout that refreshes all its children's drawables instead of just its own
Resolves https://github.com/material-components/material-components-android/issues/3233

PiperOrigin-RevId: 512678371
2023-02-27 20:48:34 +00:00
hunterstich
b3f32d42a0 [TopAppBar] Added app:layout_scrollEffect to public attributes.
PiperOrigin-RevId: 509484463
2023-02-15 10:21:30 -08:00
pubiqq
80ec5ccdd5 [AppBarLayout] Add AbsListView to views that support nested scrolling
Resolves https://github.com/material-components/material-components-android/pull/3220

GIT_ORIGIN_REV_ID=14e89d9356190155a82f01414c2221118d8d1d02
PiperOrigin-RevId: 507880939
2023-02-07 22:14:29 +00:00
dsn5ft
86600c2cf1 [MaterialToolbar] Override inflateMenu() to stop dispatching item changes during inflation for a performance improvement
PiperOrigin-RevId: 503995162
2023-01-24 11:55:47 -05:00
pekingme
4c31ab50aa Automated g4 rollback of changelist 498007913
PiperOrigin-RevId: 502944558
2023-01-19 17:49:56 +00:00
Material Design Team
0200690256 Automated g4 rollback of changelist 497863181
PiperOrigin-RevId: 498007913
2022-12-29 00:20:39 -05:00
pekingme
44445fa90a [AppBar] Integrated tokens.
PiperOrigin-RevId: 497863181
2022-12-29 00:19:54 -05:00
conradchen
7b8faef12b [TopAppBar] Fix input rectangle being modified in onRequestChildRectangleOnScreen()
Resolves https://github.com/material-components/material-components-android/issues/3054

PiperOrigin-RevId: 491440304
2022-11-28 17:17:40 -05:00
rightnao
c8108b1f8e [TopAppBar] Update motion specs
PiperOrigin-RevId: 480953621
2022-10-13 21:01:26 +00:00
rightnao
c587dd1259 [AppBarLayout] Adding new attribute liftOnScrollColor that disables elevation overlay and allows users to change the app bar color
PiperOrigin-RevId: 477794812
2022-10-03 16:57:13 +00:00
rightnao
9df6c9d072 [AppBarLayout] Fix issue with a physical keyboard scroll not collapsing toolbar
PiperOrigin-RevId: 471608866
2022-09-01 17:22:43 -07:00
rightnao
14415a1308 [AppBarLayout] Make a new setter for scroll effect and make SCROLL_EFFECT_COMPRESS public
resolves https://github.com/material-components/material-components-android/issues/2894

PiperOrigin-RevId: 471289613
2022-08-31 15:55:37 -07:00
raajkumars
4e323fa18b [M3][Search] Added search bar component.
PiperOrigin-RevId: 467749926
2022-08-16 15:18:07 -04:00
rightnao
29bed9a021 [CollapsingToolbarLayout] Exposing methods to set text size for collapsed and expanded text size
Resolves https://github.com/material-components/material-components-android/issues/775

PiperOrigin-RevId: 465391478
2022-08-05 19:10:31 +00:00
Material Design Team
7fc2aed7dc [AppBarLayout] Fix bug in HeaderScrollingViewBehavior that causes child translation Y not to be reset to default if the behavior is changed from an overlapping to non-overlapping behavior in layoutParams.setBehavior
PiperOrigin-RevId: 462201550
2022-07-20 21:49:08 +00:00
conradchen
10ac255bb2 Automated g4 rollback of changelist 457744460
PiperOrigin-RevId: 459744654
2022-07-08 13:27:04 -07:00
conradchen
ca2da6c6a4 Automated g4 rollback of changelist 454163860
PiperOrigin-RevId: 457744460
2022-06-29 14:36:58 +00:00
dsn5ft
241aa5cd8b [CollapsingToolbarLayout] Added experimental API to allow generic customizations of the StaticLayout.Builder used for the title text
Example usage:

```
collapsingToolbarLayout.setStaticLayoutBuilderConfigurer(
    builder ->
        builder.setLineBreakConfig(
            new LineBreakConfig.Builder()
                .setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE)
                .build()));
```

PiperOrigin-RevId: 455625977
2022-06-23 18:32:33 +00:00
conradchen
687e73590d [TopAppBar] Exclude gone views from scroll range calculation
Resolves https://github.com/material-components/material-components-android/issues/2709

PiperOrigin-RevId: 454163860
2022-06-10 16:38:51 -07:00
dsn5ft
c5b37e6ea6 [MaterialToolbar] Add clearNavigationIconTint() method
Resolves https://github.com/material-components/material-components-android/issues/2678

PiperOrigin-RevId: 453220817
2022-06-06 14:25:49 -07:00
pubiqq
382ce9c792 [TopAppBar] Fix copy constructors
Resolves https://github.com/material-components/material-components-android/pull/2686

GIT_ORIGIN_REV_ID=7f62b56c7edf01046e85b474d1cf0f17c6153b68
PiperOrigin-RevId: 450440535
2022-05-23 11:20:15 -04:00
Material Design Team
4b81bb1d1a [AppBarLayout] Loosen check for scrollable child when adding a11y actions
Adding the a11y delegate and a11y actions was dependent on there being a CoordinatorLayout child that both inherits from certain scrolling classes (NestedScrollingChild, ListView, ScrollView) and has an AppBarLayout scrolling behavior. This was too restrictive and so we only check for a behavior.

Any scrolling child may add an a11y delegate or scroll action to the parent CoordinatorLayout.

PiperOrigin-RevId: 448335380
2022-05-12 17:24:36 -04:00
Material Design Team
72228f4f35 [AppBarLayout] Fix scrolling for a11y
Ensure the CoL can scroll to the bottommost elements of the scrolling child, which may not be visible due to the app bar.
Also, set the node info properties to expose the CoL to auto-scrolling.

PiperOrigin-RevId: 447596411
2022-05-10 09:48:55 -04:00
Venugopal Rao Gubbala
7b043c3b68 [CollapsingToolbarLayout] Allow application to Set ellipsis to Title in CollapsingToolBar
Resolves https://github.com/material-components/material-components-android/pull/2636

GIT_ORIGIN_REV_ID=f6c2b07c1eb936ed2de47b7586688a5f6b322e48
PiperOrigin-RevId: 445200467
2022-04-28 16:26:58 -04:00