130 Commits

Author SHA1 Message Date
gauthams
64ad735c12 Add MaterialButtonToggleGroup docs
PiperOrigin-RevId: 243345601
2019-04-19 16:22:36 -04:00
afohrman
5d59ec05fc Update boxCornerRadius attributes in TextInputLayout's documentation to the correct names.
These attributes were renamed before our library was released as stable.

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

PiperOrigin-RevId: 241940785
2019-04-05 15:57:21 -04:00
gauthams
bc7a7e7961 Update MaterialButton documentation to include padding in clipToPadding snippet
PiperOrigin-RevId: 237881310
2019-03-22 16:04:38 -04:00
gauthams
916fd8760b Update MaterialButton documentation to include note about clipToPadding
PiperOrigin-RevId: 237537712
2019-03-22 15:57:41 -04:00
leticiars
eda47ac568 Updating TextInputLayout's documentation to include information about the end icon modes.
PiperOrigin-RevId: 237104993
2019-03-08 10:07:22 -05:00
gauthams
cbe25468bd Update ExtendedFloatingActionButton documentation
PiperOrigin-RevId: 235974516
2019-03-08 09:38:54 -05:00
gauthams
2f5c3143f1 Update ExtendedFloatingActionButton documentation
PiperOrigin-RevId: 235619027
2019-02-26 15:18:46 -05:00
marianomartin
88e2dd2f3c Update docs for MaterialCardView
PiperOrigin-RevId: 234983965
2019-02-24 14:27:22 -05:00
afohrman
beee015feb Use EditText's background for the filled text field and fix underline flakiness.
PiperOrigin-RevId: 231857938
2019-02-11 11:08:22 -08:00
afohrman
19039f7772 Automated g4 rollback of changelist 231246920
PiperOrigin-RevId: 231313735
2019-02-01 12:37:35 -05:00
afohrman
ef919e870a Use EditText's background for the filled text field and fix underline flakiness.
Use the EditText's background for the filled box text field and a MaterialShapeDrawable drawn to the canvas for the underline. This allows for many improvements to the filled text field.

This commit:
- Fixes the underline flakiness, where the underline used to not meet the edges until drawableStateChanged() was called after a layout pass (because TextInputLayout was attempting to use EditText's pre-existing underline, and the bounds of that Drawable weren't known in order to modify them until after drawableStateChanged())
- Removes the hard-coded box offset since it was only necessary when trying to use EditText's background drawable
- Brings the expanded label/hint a bit closer to the vertical center. Any more than this will require changing the bounds set on the expanded hint text and create misalignment between the expanded hint and any compound drawable that might be set

Specs: https://material.io/design/components/text-fields.html#spec

There is a possible alternative to drawing the underline manually: including the underline as part of the EditText's background. I investigated this option and rejected it, since it would require a re-architecture of the way TextInputLayout handles the box logic and many layers of box drawable nesting. It is much more straightforward and performant to draw the underline directly to the canvas than to convert the boxBackground to {LayerDrawable{MaterialShapeDrawable,{InsetDrawable{MaterialShapeDrawable}}}}.

This commit should only change the visuals of the filled text field; the outline text field should be visually untouched.

PiperOrigin-RevId: 231246920
2019-02-01 12:35:48 -05:00
gauthams
50d2d3c307 Update "Theme Attribute Mapping" section with opacities
PiperOrigin-RevId: 230631647
2019-01-25 14:01:07 -05:00
afohrman
0aa470af86 Support custom backgrounds for outline text fields and use EditText's background for the text field's outline.
The outline box styles previously didn't allow a custom drawable to be set. The box background was handled by TextInputLayout, which nulled out the EditText's background and drew the boxBackground directly to the canvas. That meant that a call to TextInputEditText#setBackground() would not actually do anything - it would result in the same outline text field.

In order to respect the background drawable, TextInputEditText's background is set to null in the style. Then, TextInputLayout programmatically sets the custom outline drawable if the background is already null. This avoids overwriting a drawable that may have already been set on the TextInputEditText.

This change does pretty much nothing to the filled box style; since the EditText's underline is still being used, the background of the EditText was never set to null for that style. This change should be a no-op for that style.

This move to using the EditText's background for the outline also improves the bounds of the outline text field and gets rid of the cutoff that was appearing at the top of the outline when TextInputLayout's hint was disabled and a hint was set on the EditText.

PiperOrigin-RevId: 230538561
2019-01-25 13:55:36 -05:00
Takao Chiba
d6db253586 [Docs] Fix table formatting for MaterialCardView
Resolves
https://github.com/material-components/material-components-android/pull/227

PiperOrigin-RevId: 229446278
2019-01-18 14:15:59 -05:00
ldjesper
5526e144aa Documentation updates for Dialog
PiperOrigin-RevId: 227530056
2019-01-10 15:54:56 -05:00
connieshi
6c70169e8d Update chipgroup spacing attribute documentation to clarify that it doesn't apply to hidden chips.
PiperOrigin-RevId: 226498090
2018-12-21 16:29:20 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
Material Design Team
a538254919 Fix attribute table doc for MaterialButton
PiperOrigin-RevId: 222129613
2018-12-06 11:13:40 -05:00
marianomartin
67d39c7102 Fix fab documentation
PiperOrigin-RevId: 222102418
2018-12-06 11:12:50 -05:00
connieshi
60d1dfac70 Update chipDrawable to be wrapped by InsetDrawable (if needed) to ensure it meets Android's recommended minimum touch target size.
Update demo catalog app.

PiperOrigin-RevId: 220370443
2018-11-16 10:57:34 -05:00
ldjesper
93f859fab7 Documentation updates for selection controls
PiperOrigin-RevId: 219660306
2018-11-01 16:21:29 -07:00
Material Design Team
9ab0e36ee4 Fixed the usage sample code to match what the document said at the bottom.
PiperOrigin-RevId: 216714647
2018-10-11 18:31:10 -04:00
gauthams
99d77a0c3c Update component documentation to include theme mappings for color and type
PiperOrigin-RevId: 216445191
2018-10-11 18:17:23 -04:00
dniz
868e80ed6f Add support for anchoring Snackbars to Views so they can be placed above
navigational elements and FABs

This commit also disables the pushing up of FABs when an anchor view is set

PiperOrigin-RevId: 214287486
2018-09-28 16:24:01 -04:00
dniz
a313443f9e Update AppBarLayout liftOnScroll to support nested scrolling targets
- Add liftOnScrollTargetViewId attribute to allow client to specify the scrolling view that should be listened to for updating AppBarLayout lifted state.
- Use View#canScrollVertically instead of View#getScrollY to determine lifted state.

PiperOrigin-RevId: 213614055
2018-09-28 14:55:37 -04:00
dniz
4c41bcbb3c Remove leading |'s from Chip documentation attribute table
PiperOrigin-RevId: 210588729
2018-08-28 16:44:57 -04:00
Material Design Team
b0a9ff6658 Add an override to setLayoutDirection from the parent text view of chips.
Setting layoutDirection on TextViews to the direction of the View locale is necessary to ensure that text on chips is rendered correctly in RTL mode. Previously, it would default to LTR mode and then not get set with proper paddings until you interact with a chip to invalidate the layout.

Before (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_before.mp4
After (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_after.mp4
Verified no changes to LTR.

PiperOrigin-RevId: 210560864
2018-08-28 16:43:46 -04:00
gauthams
15bf27d7cd Update MaterialButton to use new color attributes
PiperOrigin-RevId: 209617286
2018-08-28 16:31:53 -04:00
cketcham
5a5c6fe5e4 A workaround has been applied that lets us use ThemeOverlays on default styles.
PiperOrigin-RevId: 209434277
2018-08-28 16:18:16 -04:00
connieshi
fab7b4b97d Update Chip attribute table formatting so it displays properly on Github.
https://github.com/material-components/material-components-android/issues/146

PiperOrigin-RevId: 208100663
2018-08-17 17:03:26 -04:00
connieshi
d0feb4d321 Add clarification about a chip touch target delegate's boundary requirements.
PiperOrigin-RevId: 206975591
2018-08-02 18:06:57 -07:00
connieshi
7d6767cf85 Move Checkable attribute above Check Icon in attribute table.
PiperOrigin-RevId: 206578877
2018-08-02 18:04:11 -07:00
connieshi
00bbb1e16f Fix typo in chip attribute: android:checkable instead of app:checkable
Rearrange a few of the attributes to move android attributes to the top.

PiperOrigin-RevId: 206357215
2018-08-02 18:02:55 -07:00
connieshi
516d00d8a6 Add attributes (chipTouchTargetDelegate, chipMinTouchTargetSize) to support chip meeting minimum accessible touch target size.
PiperOrigin-RevId: 206197663
2018-08-02 17:58:34 -07:00
afohrman
955d47d251 Update documentation for TextInputLayout's default style.
Resolves https://github.com/material-components/material-components-android/issues/143 by clarifying that TextInputLayout does not currently set the default style because of a bug in ThemeOverlay.

PiperOrigin-RevId: 205452751
2018-07-20 18:28:16 -04:00
connieshi
6020fcdbf1 Fix API issue with icon visibility.
Deprecate *iconEnabled methods to is*iconVisible and setIs*iconVisible methods.

PiperOrigin-RevId: 202658616
2018-07-02 09:50:53 -04:00
gauthams
58df7b8baa Fixing MaterialButton padding API surface
PiperOrigin-RevId: 202584064
2018-07-02 09:49:33 -04:00
cketcham
841ba156fc Automated g4 rollback of changelist 199530791
PiperOrigin-RevId: 201188669
2018-06-20 17:29:57 -04:00
afohrman
6d28b64043 Update documentation to discourage setting the hint on TextInputEditText.
Remove ambiguity about where to set the hint by strongly recommending that it be set on the TextInputLayout.

This commit also updates the documentation to more strongly encourage the use of TextInputEditText over an EditText.

PiperOrigin-RevId: 201037651
2018-06-20 17:28:41 -04:00
cketcham
1397f5d12a Add hide on scroll docs for BottomAppBar
PiperOrigin-RevId: 199630885
2018-06-20 17:25:14 -04:00
afohrman
b087cbad7a Roll back deletion of FAB attachment functionality.
PiperOrigin-RevId: 199530791
2018-06-20 17:24:55 -04:00
connieshi
412ee4c1f1 Add support for tinting the chip icon.
PiperOrigin-RevId: 199526967
2018-06-20 17:24:18 -04:00
cketcham
cdb99838c6 Don't allow the fab to be detached from the BottomAppBar unless the fab isn't visible, or the BottomAppBar is scrolled off the screen
PiperOrigin-RevId: 199511216
2018-06-20 17:24:01 -04:00
dniz
18e1aa0d71 Add note about using <chip tag for ChipDrawable
PiperOrigin-RevId: 199172023
2018-06-20 17:22:41 -04:00
dniz
ad573c764b Clarify sizing for FloatingActionButton
PiperOrigin-RevId: 198914008
2018-06-04 10:51:12 -04:00
Bernat Borrás Paronella
d85b0f79cf Remove backslash from Floating Button style ref.
There was an unnecessary backlash in the style example.

PiperOrigin-RevId: 198911163
2018-06-04 10:49:52 -04:00
afohrman
f2ebf56e21 Rename text field outlined style from "Outline" to "Outlined".
This commit updates the style names for the outlined text field box from "Outline" to "Outlined.

Widget.MaterialComponents.TextInputLayout.OutlineBox -> Widget.MaterialComponents.TextInputLayout.OutlinedBox, and
Widget.MaterialComponents.TextInputEditText.OutlineBox -> Widget.MaterialComponents.TextInputEditText.OutlinedBox.

This name matches spec and is closer to what is used on the other platforms.

PiperOrigin-RevId: 198768731
2018-05-31 16:39:44 -04: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
gauthams
9122d5d6be Update docs to call out spacing differences in MaterialButton
PiperOrigin-RevId: 197806996
2018-05-30 17:30:59 -04:00
connieshi
a71326896a Use the android:text attribute instead of chipText attribute to specify text label for ChipDrawable.
This is one in a series of planned changes that aim to delegate rendering a Chip's text to TextView instead of ChipDrawable.

PiperOrigin-RevId: 197780081
2018-05-30 17:19:38 -04:00