23 Commits

Author SHA1 Message Date
dsn5ft
0697f6fe89 [Gradle] Enable non transitive R classes (resource namespacing) and fix errors
PiperOrigin-RevId: 738871402
2025-03-20 18:34:33 +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
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
Material Design Team
bdef355289 [TextInputEditText]Fix: TextInputEditText misses some visible lines in CursorAnchorInfo#getVisibleLineBounds after scrolled
TextInputEditText#getGlobalVisibleRect is overridden to call getGlobalVisibleRect on parent TextLayoutInput view directly. It doesn't match with the View#getGlobalVisibleRect implementation where the return globalOffset contains negative amount of the scroll in the view. As a result, calling getLocalVisibleRect will return a wrong rectangle when TextInputEiditText is scrolled.

PiperOrigin-RevId: 542341678
2023-06-26 21:26:12 +00:00
leticiars
dce4419744 [TextInputLayout][a11y] Fixed text field's focused rect wrong behavior when using a11y magnification.
Before, in requestRectangleOnScreen we were setting the text input layout’s rectangle to a specific and constant position, which caused the zoomed in screen to be fixed to the left instead of following the input text as it was typed. We should use the edit text’s rectangle’s position first, then adjust for the text field’s height (which includes the helper/error text), then use that updated rectangle on the super call of the method.

PiperOrigin-RevId: 435402032
2022-03-17 18:52:42 +00:00
afohrman
108558326d [TextInputLayout] Added class documentation to use TextInputLayout's context to construct the child TextInputEditText.
We already had class documentation that explains that TextInputEditText should be instantiated with the parent TextInputLayout's context for proper theming, but this  information is important enough to the basic usage of TextInputLayout and TextInputEditText that it's best to have it the class documentation, as well.

Added the guidance in both TextInputLayout and TextInputEditText because it's relevant to both classes.

PiperOrigin-RevId: 432244388
2022-03-04 13:03:37 -05: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
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
leticiars
b274a4aa32 [TextInputLayout][a11y] Changing hint announcement.
* To make announcements clearer, removed helper text from hint announcement.
* Calling setLabelFor on helper text view so it's clear it refers to the edit text visually above it.
* Calling setError is enough to let the screen reader decide how to announce the error.

PiperOrigin-RevId: 317651946
2020-06-26 13:59:00 -04:00
isabellekim
1f9de68025 [All] Add support for materialThemeOverlay
Resolves https://github.com/material-components/material-components-android/pull/948

GIT_ORIGIN_REV_ID=5a8bb35a56c1b813df47d964de8482a26e0da66d
PiperOrigin-RevId: 293839172
2020-02-10 09:55:19 -05:00
leticiars
9d71db9717 Adding textInputLayoutFocusedRectEnabled attr to disable using the TextInputLayout's rect by default.
PiperOrigin-RevId: 291747634
2020-01-28 16:09:58 -05:00
leticiars
237f0f3c56 Adding nullness annotations and fixing some other lint issues.
PiperOrigin-RevId: 289110313
2020-01-10 10:23:03 -08:00
Anoop
60483b53e9 [TextInputEditText] meizu to manufacture utils
Resolves https://github.com/material-components/material-components-android/pull/884

GIT_ORIGIN_REV_ID=24aef1fe592b2ce08c8a9ad7e33e396cc4eb6dd0
Co-authored-by: pekingme <pekingme@gmail.com>
PiperOrigin-RevId: 288726292
2020-01-08 12:11:02 -08:00
leticiars
2084fd3f70 [Text Fields] Pan window so that keyboard doesn't hide helper/error views.
It doesn't pan if the user can already scroll (for example if it's in a scroll view).

PiperOrigin-RevId: 286424421
2019-12-19 15:47:57 -05:00
leticiars
6efedee757 Adding onInitializeAccessibilityNodeInfo override in TextInputEditText.
In APIs < 23 some things set in TextInputLayout's AccessibilityDelegate get overwritten, so announcements are not as expected.

PiperOrigin-RevId: 283396918
2019-12-03 17:04:54 -05:00
cketcham
440b6e7753 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057396
2019-08-29 10:30:58 -04:00
Antonin Fouques (CmoaToto)
7787a8257d use .equalsIgnoreCase(...) instead of .toLowerCase().equals(...)
GIT_ORIGIN_REV_ID=173665654ad165cee4c3da64af4fd60afa9a1f61

Resolves https://github.com/material-components/material-components-android/pull/411

PiperOrigin-RevId: 256404636
2019-07-03 15:19:19 -04:00
Antonin Fouques (CmoaToto)
ccb7fbe8b3 Simplify Meizu fix by forcing creation of a hintLayout
GIT_ORIGIN_REV_ID=5545bb3920a651e8a2e1f1a0586fbecdad7c55bb

Resolves https://github.com/material-components/material-components-android/pull/358

PiperOrigin-RevId: 248391866
2019-05-16 17:25:11 -04:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
afohrman
bdb25ff7e3 Use android:padding attributes instead of boxPadding attributes for text field dimensions.
Move to use native android:padding attrs instead of custom boxPadding attributes for text fields. This is accomplished by creating box styles for TextInputEditText, and setting android:padding attributes in those.

The TextInputLayout box styles set the appropriate TextInputEditText style on its child by wrapping the TextInputEditText style in theme overlays. This is kind of neat, since it allows for the user not to have to set a style on both the TextInputLayout and TextInputEditText - the user does not even have to know about the TextInputEditText styles with this pattern. It should also help clear up some confusion over where to set the hint and other areas of haziness between TextInputLayout and TextInputEditText.

The default editTextStyle is set to the filled box style, to match the default TextInputLayout style.

This change removes the box padding attributes, and it also removes the dimension resources in favor of setting them in the style to improve readability.

This commit also changes TextInputEditText constructors to both use a theme attribute in the 3-arg constructor and call through to the TextInputEditText overloaded constructors rather than call the super's constructor from each. This allows the theme attribute set in the theme overlays to take effect.

PiperOrigin-RevId: 198051251
2018-05-30 17:35:13 -04:00
Material Design Team
3e20d0720f Hide TextInputLayout from accessibility services and instead mirror its attributes on its EditText.
PiperOrigin-RevId: 197509011
2018-05-22 13:59:17 -04:00
afohrman
6cb4f6eebe Fix typo in TextInputEditText documentation.
PiperOrigin-RevId: 193966868
2018-04-30 11:57:29 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00