2206 Commits

Author SHA1 Message Date
Bruno Coelho
6d29bddb0f Merge branch 'master' into feature/bottomsheetdialogfragment-layoutid-in-constructor 2021-11-17 21:32:22 +00:00
conradchen
6b57c52973 [M3][NavigationRail] Update M3 navigation rail text appearances
PiperOrigin-RevId: 410245619
2021-11-16 12:39:35 -05:00
conradchen
728a1e658b [M3][Dialog] Enforce material theme in M3 dialog styles
PiperOrigin-RevId: 410027983
2021-11-16 12:38:56 -05:00
conradchen
04a6b6c39e [M3][Tab] Do not enforce text appearance with M3 styles
PiperOrigin-RevId: 409445341
2021-11-16 12:35:44 -05:00
serniebanders
d5729d5935 Automated g4 rollback of changelist 409212345
PiperOrigin-RevId: 409279906
2021-11-16 12:34:36 -05:00
conradchen
fba1a341c3 [M3][DatePicker] Fix M3 date picker styles
Some attributes were wrongly added to the styles. We need to remove them to make the color correct.

PiperOrigin-RevId: 409241943
2021-11-16 12:33:57 -05:00
conradchen
cc18f3f7e8 [M3][Chip] Add missing attributes to M3 chip styles
PiperOrigin-RevId: 409239837
2021-11-16 12:31:56 -05:00
serniebanders
022a05f526 [BottomSheetBehavior] Add margin flags to BottomSheetBehavior for system inset bars.
Updates bottom sheet styles to default to left and right margins, top and bottom padding.

Resolves: https://github.com/material-components/material-components-android/issues/2221
PiperOrigin-RevId: 409212345
2021-11-16 12:29:43 -05:00
leticiars
b878fc3209 [a11y][ExposedDropdownMenu] accessibilityManager.isEnabled() is not reliable to check if component is in a11y mode, as it may return true unexpectedly.
Automated g4 rollback of changelist 408655618

PiperOrigin-RevId: 409182047
2021-11-16 12:28:50 -05:00
Bruno Coelho
8fb12fd2f6 Merge branch 'master' into feature/bottomsheetdialogfragment-layoutid-in-constructor
# Conflicts:
#	build.gradle
2021-11-11 20:26:33 +00:00
pfthomas
c07e5f2c36 [TimePicker][a11y] Fix Talkback doesn't announce minutes selection
PiperOrigin-RevId: 408921292
2021-11-10 17:00:22 -05:00
conradchen
44d4c3ea3f [TopAppBar] Correctly set letter spacing when expanding titles
We recreated title text layout when expanding from the collapsed state but didn't correctly set the letter spacing to the expanded one. The letter spacing being used will be a interpolated value between collapsed and expanded letter spacing (close to the collapsed one due to the implementation). This will cause the text layout incorrectly calculate the line count from the wrong letter spacing and result in a broken layout.

Correctly sets the letter spacing to fix the issue.

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

PiperOrigin-RevId: 408910555
2021-11-10 16:54:12 -05:00
conradchen
34cce18d4a [TextField] Correctly calculate hint text offset
We changes letter spacing during expanding/collapsing animations, which causes us use letter spacing during animation while calculating final expanded/collapsed offset instead of final letter spacing. This in turn causes hints be drawn at the wrong positions. Uses final letter spacing during calculating offset instead to fix the problem.

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

PiperOrigin-RevId: 408904991
2021-11-10 16:52:14 -05:00
conradchen
e6db8a4d31 [TopAppBar] Fix text alignment of multi-line title in collapsing toolbar
In single line mode, we implement the expanded title alignment by calculating the expected x-coordinate of expanded title and translate the canvas so the title will be aligned. However, when maxLines > 1, the static layout will always occupy the full available width, therefore the text alignment need to be done by the static layout instead.

Provides text alignment other than NORMAL when it's in multi-line mode to solve the issue.

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

PiperOrigin-RevId: 408895140
2021-11-10 16:13:26 -05:00
conradchen
823c34a90c [Tab] Fix NPE caused by set a position less than 0
If somehow scroll position is set to -1 with and position offset greater than 0.5, we will decide it's a valid scroll position which causes NPE for selected child not found.

Fixes this by checking if position is valid regardless the offset and falling back to 0 if a negative position is given.

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

PiperOrigin-RevId: 408894188
2021-11-10 16:12:49 -05:00
conradchen
283715d348 [Card] Fix checked icon gravity issues
Re-measures the card when checked icon gravity changes in order to move the icon position. Also corrects the padding adjustment logic for pre-lolipop or when compat paddings are being used.

PiperOrigin-RevId: 408876717
2021-11-10 16:11:35 -05:00
pfthomas
38406e15a5 [TimePicker][a11y] Make Talkback announce action on clock items
PiperOrigin-RevId: 408660379
2021-11-10 16:09:26 -05:00
leticiars
d8e19ddedf [a11y][ExposedDropdownMenu] Fixed dropdown list not showing for non editable dropdown menus in switch access mode.
For the editable type it remains as was: clicking on the edit text triggers the keyboard and clicking on the arrow icon shows the dropdown list.

PiperOrigin-RevId: 408655618
2021-11-10 16:06:58 -05:00
leticiars
c7c5c7c625 [TextInputLayout] Fixed calculateLabelMarginTop() value for filled text field style, which caused getBaseline() to return a wrong offset.
PiperOrigin-RevId: 408655451
2021-11-10 16:06:08 -05:00
conradchen
c80177d062 [CollapsingTextHelper] Small clean-up of CollapsingTextHelper
PiperOrigin-RevId: 408644009
2021-11-10 16:04:13 -05:00
leticiars
dca7fc0701 [TextInputLayout][a11y] Fixed RTL support for setting corner radius on TextInputLayout.
PiperOrigin-RevId: 408621523
2021-11-10 16:03:01 -05:00
pfthomas
c6be59ce8b [Chip][a11y] Fix system level bold not applied
PiperOrigin-RevId: 408609073
2021-11-10 16:02:22 -05:00
conradchen
bc56d5b43b [M3][Card] Change checkedIconGravity values to enum
PiperOrigin-RevId: 408415041
2021-11-10 16:00:52 -05:00
leticiars
9b5356f2fe [DatePicker] Wrapped text fields from range picker selection in a ScrollView so their heights don't change in landscape mode.
PiperOrigin-RevId: 408333813
2021-11-10 15:57:22 -05:00
Gabriele Mariotti
250d56de4b [MaterialCardView] Added option to set the checkedIcon gravity
Resolves https://github.com/material-components/material-components-android/pull/1679

GIT_ORIGIN_REV_ID=a35c862071d83ced72c4d7257f2b7bc93101bfbb
PiperOrigin-RevId: 407662373
2021-11-10 15:35:03 -05:00
conradchen
e9ec82f5e9 [M3][Chip] Add input chip elevated styles to public
PiperOrigin-RevId: 407408090
2021-11-04 10:54:56 -04:00
conradchen
8ed0ac9fd3 [M3][Chip] Update M3 chip styles with spec
Adds elevation to selected & hovered state. Adds leading icon tint.

PiperOrigin-RevId: 407397700
2021-11-04 10:53:39 -04:00
Gabriele Mariotti
b2fbacecd4 [MaterialDatePicker] added methods to use custom text for positive and negative button
Resolves https://github.com/material-components/material-components-android/pull/1607

GIT_ORIGIN_REV_ID=75093200ddeae117ae57a3e89e28d109f520ec8d
PiperOrigin-RevId: 407376627
2021-11-04 10:53:04 -04:00
Material Design Team
aaac96d724 [TextField] Fix helper text label for usage
The setLabelFor calls were made in the call to populate the accessibility node but they were made after calling super (one of them was actually nested inside of a getter!), this is too late, the accessibility node is populated with the label for by the super class

PiperOrigin-RevId: 407178334
2021-11-04 10:52:21 -04:00
conradchen
a455a53a6d [M3][Color] Move dynamic color public resources to all versions
PiperOrigin-RevId: 407141799
2021-11-04 10:51:45 -04:00
conradchen
e5023f63ae [M3][Colors] Add supporting manufacturer list of dynamic colors
PiperOrigin-RevId: 406892239
2021-11-04 10:49:57 -04:00
Khang NT
b935604e2c [AppBarLayout] Fix snap issue with transparent status bar
Resolves https://github.com/material-components/material-components-android/pull/2387

GIT_ORIGIN_REV_ID=47538c3b4cb10337c537d1ef532bd1d73b216ae3
PiperOrigin-RevId: 406835368
2021-11-01 19:53:05 +00:00
pfthomas
bed2ac17a7 [M3] Add textAppearanceListItem* styles to theme
PiperOrigin-RevId: 406832937
2021-11-01 19:31:19 +00:00
leticiars
9d2f864f0a [TextInputLayout] Fixed getBoxCornerRadiusBottomEnd and getBoxCornerRadiusBottomStart returning wrong values.
PiperOrigin-RevId: 406360531
2021-10-29 18:48:29 +00:00
leticiars
c352dfde8d [TextInputLayout] Fixed shouldAnimateCaptionView() returning true when captionText is null.
captionView.getText() doesn't ever return null (only "" if it's empty), so changed captionText parameter to be @NonNull

PiperOrigin-RevId: 406358148
2021-10-29 18:47:26 +00:00
leticiars
3ca3b71bb2 [TextInputLayout] Don't add placeholder view to text field's input frame if placeholder is null.
PiperOrigin-RevId: 406129696
2021-10-28 18:50:16 +00:00
leticiars
20c3ad0413 [a11y][TextInputLayout] Removed TextInputLayout's placeholder text duplicated announcement.
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.

PiperOrigin-RevId: 405668594
2021-10-27 18:54:35 +00:00
pfthomas
dbd37d2791 [BottomSheetBehavior] Remove IllegalArgumentException in settleToState
PiperOrigin-RevId: 405497835
2021-10-27 18:53:26 +00:00
conradchen
dc0c5f3d85 [M3][Color] Add public dynamic color resources
PiperOrigin-RevId: 405411796
2021-10-25 16:10:26 +00:00
Material Design Team
8bf3bdeb8a Automated g4 rollback of changelist 404871534
PiperOrigin-RevId: 404899483
2021-10-25 16:08:53 +00:00
leticiars
2701161bbd [a11y][TextInputLayout] Removed TextInputLayout's placeholder text duplicated announcement, and fixed edge case where placeholder text was being enabled and added to the input frame while it was set to null.
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.

PiperOrigin-RevId: 404871534
2021-10-25 16:07:47 +00:00
conradchen
abb9d5bf99 [M3][Chip] Update chip styles with spec
PiperOrigin-RevId: 404852054
2021-10-25 16:06:43 +00:00
Material Design Team
df873168e0 [M3][Color] Harmonize iteration
PiperOrigin-RevId: 404797844
2021-10-21 18:56:00 +00:00
dsn5ft
3a57f5d58b [TimePicker] Attempt to fix onDoubleTap() NullPointerException
PiperOrigin-RevId: 404651939
2021-10-21 18:54:41 +00:00
conradchen
8729d8ab57 [SnackBar] Fix maxWidth and maxInlineActionWidth are not applied
We load maxWidth and maxInlineActionWidth style attributes in SnackbarContentLayout, but the snackbar styles are only applied to SnackbarLayout. We need to pass the values to SnackbarContentLayout, as we did for actionTextColorAlpha.

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

PiperOrigin-RevId: 404320339
2021-10-20 19:18:47 +00:00
Material Design Team
01c1fc723d Automated g4 rollback of changelist 404266249
PiperOrigin-RevId: 404294350
2021-10-20 19:11:30 +00:00
conradchen
d10c75b357 [TextField] Fix collapsed hint cutout is not correctly applied
The box background of text fields are applied to EditTexts instead of the TextInputLayout. So when there are paddings in TextInputLayout, we will need to adjust cutout bounds, which is calculated based on TextInputLayout's coordinates, according to the paddings.

PiperOrigin-RevId: 404281248
2021-10-20 19:09:50 +00:00
leticiars
aa58657042 [a11y][TextInputLayout] Removed TextInputLayout's placeholder text duplicated announcement.
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.

PiperOrigin-RevId: 404266249
2021-10-20 19:07:29 +00:00
dsn5ft
9ae56ceedd [Javadocs] Remove all broken attr links from Javadocs
PiperOrigin-RevId: 404246710
2021-10-20 19:06:18 +00:00
pekingme
9de9319b1e [Resources] Added styles in res-public.
PiperOrigin-RevId: 403451624
2021-10-18 15:31:13 -04:00