49 Commits

Author SHA1 Message Date
pubiqq
e3a3093309 [Internal] Use monotonic clock to measure time intervals
Resolves https://github.com/material-components/material-components-android/pull/4289

GIT_ORIGIN_REV_ID=6686c2a3101c235c1fec087a0f77acbfecd23540
PiperOrigin-RevId: 718390534
2025-01-22 17:54:49 +00:00
pubiqq
23aca03255 [Internal] Remove pre-Lollipop checks
Resolves https://github.com/material-components/material-components-android/pull/4266

GIT_ORIGIN_REV_ID=1de7808e66dd6666c893217c76c7499afe2df6a3
PiperOrigin-RevId: 669688797
2024-09-03 13:31:29 +00:00
pubiqq
204811089d [Internal] Replace deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4180

GIT_ORIGIN_REV_ID=8e4ec29abacc33cde748b8f07f0ba5c251cef395
PiperOrigin-RevId: 656004130
2024-07-25 19:09:36 +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
Material Design Team
14a7b40363 [AutoComplete] Enabled switch access in MaterialAutoCompleteTextView.
PiperOrigin-RevId: 587556416
2023-12-04 15:51:51 +00:00
pfthomas
3b99749bc8 [DropdownMenu][a11y] Fix incorrect state
PiperOrigin-RevId: 502659684
2023-01-18 15:26:10 +00:00
rightnao
c98480c019 [TextInputLayout] Update motion attributes for textfield animations
PiperOrigin-RevId: 472525831
2022-09-08 13:24:09 -04:00
raajkumars
673cefc714 [TextInputLayout] Fix for TextInputLayout leak via AccessibilityManager.
Resolves https://github.com/material-components/material-components-android/issues/2615

PiperOrigin-RevId: 449517571
2022-05-18 21:12:36 -04:00
conradchen
ac74bc3bfd [CleanUp][TextField] Centralize icon view state handling logic
Note that there are a slight behavior changes - when a new end icon mode is set, the state will always be reset, if applicable. This should be logically more consistent and correct than the current behavior.

PiperOrigin-RevId: 449027939
2022-05-16 16:09:50 -04:00
conradchen
86b512a81c [CleanUp][TextField] Move end icon and content description logic to the layout class
PiperOrigin-RevId: 448036109
2022-05-11 14:59:46 -04:00
conradchen
d3ab6d7bf1 [CleanUp][TextField] Centralize accessibility event dispatching logic for drop-downs
This also fixes the bug that clients cannot use custom AccessibilityDelegate with drop-down mode.

PiperOrigin-RevId: 447748501
2022-05-10 15:04:34 -04:00
conradchen
7b2f92443a [CleanUp][TextField] Remove TextInputLayout.getEditText() calls from EndIconDelegates
PiperOrigin-RevId: 446240046
2022-05-03 15:06:11 -04:00
conradchen
1a42c743fe [CleanUp][TextField] Move drop-down background and ripple creation to TextInputLayout class
This CL also cleans up and fixes the edit text background setting logic - when the edit text is an autocomplete text view and provides its own background, we won't override the background by trying to add ripples to it.

Later they should be split again from the main class with other box-background-relevant logic.

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

PiperOrigin-RevId: 445486075
2022-05-02 09:19:04 -04:00
conradchen
a0e8c35470 [CleanUp][TextField] Create EndIconDelegate.deactivate() method and remove the relevant listener
PiperOrigin-RevId: 442846789
2022-04-19 13:57:46 -04:00
conradchen
26308d97d8 [CleanUp][TextField] Centralize EndIconDelegate listener logic
It provides better performance and memory management.

PiperOrigin-RevId: 441566824
2022-04-14 13:15:33 -04:00
leticiars
2c335b5f77 [ExposedDropdownMenu] Updated the elevation of the popup to match M3 specs. Also fixed bug where elevation wasn't being read via xml.
PiperOrigin-RevId: 440397922
2022-04-11 11:17:51 -04:00
leticiars
df3a708392 [ExposedDropdownMenu] Fixed android:popupBackground not working in xml/styles for the AutoCompleteTextView.
Before, its value was being overwritten in code where we set the default popup background, so we should null it in the Material styles.

PiperOrigin-RevId: 437813304
2022-03-30 15:12:06 +00:00
leticiars
1c02b62eaf [ExposedDropdownMenu] Update background when setInputType is called so that ripple is or isn't present properly.
PiperOrigin-RevId: 437345929
2022-03-28 16:47:36 +00:00
leticiars
01021a710a [ExposedDropdownMenu][a11y] Fixed bug where setting the AutoCompleteTextView's input type to TYPE_NULL in code would make it unusable in a11y touch mode, as it was still seen as editable for a11y.
Fixed by checking for the input type instead of the key listener (which remains as non null when updating the input type).

PiperOrigin-RevId: 436308197
2022-03-28 15:55:36 +00:00
conradchen
6cdf7b5155 [CleanUp][TextField] Extract end components from TextInputLayout
PiperOrigin-RevId: 435390505
2022-03-17 18:51:39 +00:00
leticiars
b9a21f0d97 [a11y][ExposedDropdownMenu] Fixed end icon focus in a11y mode when a11y mode is turned on/off after views have been attached. Also added a11y tests.
PiperOrigin-RevId: 433472357
2022-03-09 22:11:21 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
leticiars
2d337c5b81 [A11y][ExposedDropdownMenu] Improved accessibility for switch access.
Now clicking on dropdown menu via switch access triggers the dropdown list. Plus, the arrow icon is set to be not important for a11y only for screen readers.

PiperOrigin-RevId: 410858001
2021-11-29 16:55:06 +00: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
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
dca7fc0701 [TextInputLayout][a11y] Fixed RTL support for setting corner radius on TextInputLayout.
PiperOrigin-RevId: 408621523
2021-11-10 16:03:01 -05:00
conradchen
717774ec7f [TextField] Do not load default drawable if custom end icon is being used
Resolves https://github.com/material-components/material-components-android/issues/2085

PiperOrigin-RevId: 382785324
2021-07-07 19:21:28 +00:00
Amr
dd0e697aca [TextInputLayout] Fix IndexOutOfBoundsException when trying to change end icon
Resolves https://github.com/material-components/material-components-android/pull/1788
Resolves https://github.com/material-components/material-components-android/issues/1724
Resolves https://github.com/material-components/material-components-android/issues/1748

PiperOrigin-RevId: 345541684
2020-12-04 09:47:38 -05:00
leticiars
be8fc51596 [ExposedDropdownMenu][a11y] Fixed dropdown list not focusing for editable dropdown menus.
Focusing on the layout will let user type, while the arrow icon is what will trigger showing/hiding the dropdown list (which gains focus automatically).

PiperOrigin-RevId: 322846934
2020-07-27 13:19:21 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
leticiars
023e5182bf [ExposedDropDownMenu] Changed the editable exposed dropdown menu's a11y class name to be EditText instead of a drop down since the primary action for the user is to type.
PiperOrigin-RevId: 317650366
2020-06-26 13:58:17 -04:00
marianomartin
20e238869c [Internal] Added a TextWatcherAdapter class
PiperOrigin-RevId: 317355871
2020-06-26 13:57:26 -04:00
leticiars
e315754617 [TextInputLayout] Fixing end icon having unexpected behaviors when it's switched from another end icon mode.
Resolves https://github.com/material-components/material-components-android/issues/503

PiperOrigin-RevId: 312129467
2020-05-19 10:06:36 -04:00
leticiars
fd848e8aac [ExposedDropdownMenu] Fixing double click sound when layout is clicked.
PiperOrigin-RevId: 299828619
2020-03-09 11:50:08 -07:00
leticiars
237f0f3c56 Adding nullness annotations and fixing some other lint issues.
PiperOrigin-RevId: 289110313
2020-01-10 10:23:03 -08:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
cketcham
440b6e7753 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057396
2019-08-29 10:30:58 -04:00
leticiars
896e432945 Refactoring TextInputLayout.On*Listeners and restricting EndIconMode annotation.
PiperOrigin-RevId: 260516099
2019-07-29 16:47:05 -04:00
leticiars
3f73804b57 Implementing error icon for text fields.
They are set by default when the text field is on error state, but can be disabled by setting the error icon drawable to null via the errorIconDrawable attribute or the setErrorIconDrawable method.

PiperOrigin-RevId: 260495196
2019-07-29 16:43:16 -04:00
marianomartin
2241380dba Internal cleanup
PiperOrigin-RevId: 259753640
2019-07-24 15:09:18 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
marianomartin
367b295624 Internal cleanup
PiperOrigin-RevId: 254414602
2019-06-24 17:12:42 -04:00
leticiars
326dc8a13a Animating dropdown arrow icon.
PiperOrigin-RevId: 254279577
2019-06-24 17:05:54 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
leticiars
cb5430e117 Some Exposed Dropdown Menu accessibility improvements:
- fixing the layout not responding to TalkBack double click
- making the end icon not be focusable in accessibility mode
- making TalkBack announcement be the same as the Spinner's

PiperOrigin-RevId: 251479580
2019-06-10 08:54:13 -07:00
marianomartin
90837ec485 Internal cleanup
PiperOrigin-RevId: 249243403
2019-05-21 12:15:07 -04:00
leticiars
837febea61 Adding the EditText as a parameter for onEditTextAttached().
PiperOrigin-RevId: 248218371
2019-05-16 17:17:14 -04:00
leticiars
c71b6ccb13 Exposed Dropdown Menu (https://material.io/design/components/menus.html#exposed-dropdown-menu).
An AutoCompleteTextView should be used in the place of a TextInputEditText, along with with a Widget.MaterialComponents.TextInputLayout.(...).ExposedMenuDropdown style.

PiperOrigin-RevId: 246343749
2019-05-03 10:58:36 -04:00