26 Commits

Author SHA1 Message Date
Material Design Team
d8cc690b51 [ExposedDropdownMenu][A11y] Add keyboard support for dropdown menus
PiperOrigin-RevId: 788007779
2025-07-28 17:10:55 +00:00
dsn5ft
0697f6fe89 [Gradle] Enable non transitive R classes (resource namespacing) and fix errors
PiperOrigin-RevId: 738871402
2025-03-20 18:34:33 +00:00
Material Design Team
76dce7347b Automated g4 rollback of changelist 716328564
PiperOrigin-RevId: 720889049
2025-01-31 15:18:55 +00:00
conradchen
690bbfc917 [TextField] Fix the issue that menu items gets filtered after recreation
It's actually a bug of framework's AutoCompleteTextView. When restoring the
state, it always filters the item list regardless the previously input item
is from menu selection or manual input.

This change fixes the issue by implementing the custom logic of input text
saving/restoring, and properly remember if the last input text filters the
item list or not.

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

PiperOrigin-RevId: 716328564
2025-01-16 20:37:01 +00:00
pubiqq
bc2fdeadaf [Internal] Prefer platform methods to compat ones
Resolves https://github.com/material-components/material-components-android/pull/4532

GIT_ORIGIN_REV_ID=180dec736f2521579e483317a4d537629d8f247b
PiperOrigin-RevId: 715494344
2025-01-15 18:06:07 +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
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
Ga\u00ebtan Muller
b3fe6a7f61 [Cleanup] Remove redundant version checks for api <= 19.
Resolves https://github.com/material-components/material-components-android/pull/3849

GIT_ORIGIN_REV_ID=47bb2fcc8031740e5a7d4f741f1ada2af025e126
PiperOrigin-RevId: 632154861
2024-05-09 18:46:02 +00:00
Material Design Team
14a7b40363 [AutoComplete] Enabled switch access in MaterialAutoCompleteTextView.
PiperOrigin-RevId: 587556416
2023-12-04 15:51:51 +00:00
pekingme
1562d0b64f [ExposedDropdownMenu] Added attribute to set dropdown menu's container.
PiperOrigin-RevId: 528578402
2023-05-02 16:10:48 -04:00
Material Design Team
644d141359 [ExposedDropdownMenu] Dismiss modal popup in dismissDropDown
PiperOrigin-RevId: 484502383
2022-10-28 07:45:40 -07:00
Material Design Team
db115f0a1f [ExposedDropdownMenu] Fix MaterialAutoCompleteTextView.setDropDownBackgroundDrawable(Drawable).
[TextField] MaterialAutoCompleteTextView uses a ListPopupWindow to show a modal dropdown menu when in "Accessibility Touch Exploration" mode. This popup also should respond to setDropDownBackgroundDrawable(Drawable).

PiperOrigin-RevId: 482233381
2022-10-21 16:23:52 +00:00
conradchen
2db8b0cd5a [TextField] Link OnItemSelectedListener of AutoCompleteTextView with the actual drop-down list
Framework has no default implementation of how or when OnItemSelectedListener will be called. We need to link it with the actual ListPopupWindow we are going to show.

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

PiperOrigin-RevId: 449725174
2022-05-19 14:24:31 -04:00
leticiars
6206ff5a1f [ExposedDropdownMenu] Added support for default/ripple background colors for the selected item of the exposed dropdown menu when the default MaterialAutoCompleteArrayAdapter is being used.
PiperOrigin-RevId: 447531152
2022-05-09 17:35:43 -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
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
f915ffdd8a [ExposedDropdownMenu] Removed update dropdown background call from setInputType as it indirectly calls setRawInputType
PiperOrigin-RevId: 439311647
2022-04-05 15:08:02 -04:00
leticiars
f31414af02 [ExposedDropdownMenu] Update dropdown background when setRawInputType is called.
PiperOrigin-RevId: 438829151
2022-04-05 13:39:43 -04: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
conradchen
85ed9938d7 [TextField] Provide set simple items API with default item layout for MaterialAutoCompleteTextView
Resolves https://github.com/material-components/material-components-android/issues/692

PiperOrigin-RevId: 428832331
2022-02-15 19:33:49 +00: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
Yurii Blinov
c59acae371 [MaterialAutoCompleteTextView] NullPointerException on Meizu devices closes #1347
Resolves https://github.com/material-components/material-components-android/pull/1354
Resolves https://github.com/material-components/material-components-android/issues/1347

GIT_ORIGIN_REV_ID=506d9c8197cab69d63c1415237f2e75a0af1b155
PiperOrigin-RevId: 314222991
2020-06-02 12:48:41 -04:00
leticiars
7879953930 [ExposedDropdownMenu] it should be getInt instead of getResourceId in order to properly read android:inputType
PiperOrigin-RevId: 302480767
2020-03-24 11:37:26 -04:00
leticiars
6e72652310 [ExposedDropdownMenu] Fixing width being too small when it's wrap_content.
Resolves https://github.com/material-components/material-components-android/issues/1001

PiperOrigin-RevId: 301415436
2020-03-18 17:34:28 -04:00
leticiars
d1850a3d78 [ExposedDropdownMenu] Implement workaround to inputType=none not working + move MaterialAutoCompleteTextView to textfield/ directory.
The alternative to android:editable="false" (which is deprecated) is to set inputType="none", however due to a framework bug that has no effect. This change makes it so it works as expected.

PiperOrigin-RevId: 299411110
2020-03-09 09:36:24 -07:00