97 Commits

Author SHA1 Message Date
dniz
11d5335ea9 Remove 1 pixel hairline from BottomAppBar
PiperOrigin-RevId: 199356320
2018-06-20 17:23:17 -04:00
dniz
a0457bce83 Restrict AnimatorSetCompat to library usage
PiperOrigin-RevId: 199231917
2018-06-20 17:22:57 -04:00
marianomartin
dc36a0999c Allow icon to be centered with text in MaterialButton
PiperOrigin-RevId: 199138977
2018-06-20 17:22:24 -04:00
dniz
ad573c764b Clarify sizing for FloatingActionButton
PiperOrigin-RevId: 198914008
2018-06-04 10:51:12 -04:00
dniz
91196d1163 Add get/setItemBackground() Drawable methods to BottomNavigationView
PiperOrigin-RevId: 198911383
2018-06-04 10:50:40 -04:00
connieshi
57aeb2b7f8 Android Studio is looking for a "Chip" declare-stylable when trying to determine what attributes are applicable for the "Chip" component. Android Studio doesn't know that "ChipDrawable" is used internally and all attributes to "ChipDrawable" applies.
This is preventing completions of attribute names for Chip and the attribute panels shows up empty for Chip.

Rename R.styleable.ChipDrawable to R.styleable.Chip and update ChipDrawable to use it.

AS 3.2 canary > 14  (currently 16) is required to see the attributes in the attribute panel.

PiperOrigin-RevId: 198909123
2018-06-04 10:49:01 -04:00
connieshi
4a7bd84360 Add null check to Chip#setText and ChipDrawable#setText. Set null text to empty string, this is done internally by TextView.
Changed Chip#getText and ChipDrawable#getText to be @NotNull

PiperOrigin-RevId: 198868472
2018-06-04 10:48:35 -04:00
cketcham
cf65d74636 Fix BottomSheetBehavior bug for horizontal swipes.
This fixes a jumpy behavior caused by swiping quickly horizontally on a bottom sheet.

PiperOrigin-RevId: 198868074
2018-06-04 10:48:01 -04:00
dniz
c9fbe7fed6 Annotate MaterialButton color and dimension methods
PiperOrigin-RevId: 198770878
2018-05-31 17:04:32 -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
dniz
76bf445390 Annotate BottomAppBar dimension methods
PiperOrigin-RevId: 198767414
2018-05-31 16:36:00 -04:00
afohrman
0518a3d651 Add missing public attributes.
Looks like some styles and component style attributes slipped by.

PiperOrigin-RevId: 198762794
2018-05-31 16:35:29 -04:00
afohrman
7c77374127 Set textInputStyle to Widget.Design.TextInputLayout and remove editTextStyle from the theme.
The editTextStyle is now implicitly set to Widget.AppCompat.EditText.

The background for this change is that all EditTexts in the theme were getting the filled box text field set on it rather than Widget.AppCompat.EditText. Because the TextInputEditText style is set via a ThemeOverlay, simply setting the correct style on the TextInputEditText wouldn't remove the attributes set in the filled box ThemeOverlay. This commit sets textInputStyle to Widget.Design.TextInputLayout to work around that.

This commit also adds a legacy text field demo. This should help ensure that the pre-existing text field isn't changed as a result of other modifications to the text field.

PiperOrigin-RevId: 198758642
2018-05-31 16:32:59 -04:00
connieshi
f35acd8660 Rolling back again because of bad interactions with espresso ViewMatchers.
PiperOrigin-RevId: 198709590
2018-05-31 16:31:26 -04:00
connieshi
200fdcb6a2 Rolling forward changes to override Chip#getText() and Chip#setText(CharSequence, BufferType) now that a bug in ChipDrawable#getText has been fixed and internal tests are passing again.
PiperOrigin-RevId: 198616302
2018-05-30 17:46:46 -04:00
gauthams
670787be83 Update button to use textappearance theme attributes, and enforce textappearance check
PiperOrigin-RevId: 198609334
2018-05-30 17:45:15 -04:00
cketcham
a7ad02eb7b Add hideOnScroll attr to the BottomAppBar javadoc
PiperOrigin-RevId: 198596762
2018-05-30 17:44:54 -04:00
cketcham
bc9224e122 Add missing accessor methods for BottomAppBar
PiperOrigin-RevId: 198593477
2018-05-30 17:44:24 -04:00
Aleksander Ermakov
84663583b7 Set indicator bottom padding to always be 0.
There was extra padding at the bottom of the indicator view (i.e. the helper or error TextView underneath the text field. This commit removes that extra padding.

PiperOrigin-RevId: 198578652
2018-05-30 17:43:55 -04:00
connieshi
bb8f8388e7 Prevent users from setting the background attribute because Chip manages its own background drawable.
Allow setBackground to be called by Chip itself internally to set the background to be chipDrawable or ripple.

PiperOrigin-RevId: 198572908
2018-05-30 17:43:30 -04:00
marianomartin
663fd7abff add res-public files
PiperOrigin-RevId: 198567215
2018-05-30 17:42:48 -04:00
cketcham
eb56a61a3b Fix BottomAppBar top edge to prevent pointy corners
PiperOrigin-RevId: 198550727
2018-05-30 17:42:24 -04:00
Material Design Team
390a7acbf8 Causes TextInputLayout to expose its AccessibilityNodeInfo as contentInvalid if its character counter has overflowed
PiperOrigin-RevId: 198481505
2018-05-30 17:41:46 -04:00
connieshi
77f4a89f73 Automated g4 rollback of changelist 198434516
PiperOrigin-RevId: 198449773
2018-05-30 17:41:19 -04:00
connieshi
5acdd69431 Prevent users from setting the background attribute because Chip manages its own background drawable.
PiperOrigin-RevId: 198434516
2018-05-30 17:40:14 -04:00
connieshi
de67e0d8ea Keep reference to user provided value in ChipDrawable#setText and return it in ChipDrawable#getText.
Currently when a user specifies an instance of java.lang.String to ChipDrawable#setText, ChipDrawable#getText incorrectly returns an instance of android.text.SpannableStringBuilder.

PiperOrigin-RevId: 198393803
2018-05-30 17:37:23 -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
connieshi
9492832207 Rolling back changes to override Chip#setText and Chip#getText because it broke some tests.
PiperOrigin-RevId: 197975319
2018-05-30 17:34:46 -04:00
connieshi
e3303db70c Override Chip#getText() to return the internal chip text value via chipDrawable#getChipText.
Override Chip#setText(CharSequence, BufferType) to set the value on the internal chip text and prevent text from being set on Chip's super class because ChipDrawable will handle text rendering.
     - This method is called by all overridden versions of TextView#setText except android.widget.TextView#setText(char[], int, int)}, which cannot be overridden. This is not ideal but an incremental change towards supporting all flavors of android.widget.TextView#setText methods.

Deprecate Chip#setChipTextResource(int) and Chip#setText(CharSequence)

PiperOrigin-RevId: 197960701
2018-05-30 17:34:04 -04:00
connieshi
2072f7af4d Rename ChipDrawable#getChipText to ChipDrawable#ChipDrawable#getText
Rename ChipDrawable#setChipTextResource to ChipDrawable#setTextResource
Rename ChipDrawable#setChipText to ChipDrawable#setText.

PiperOrigin-RevId: 197948000
2018-05-30 17:33:30 -04:00
cketcham
c172562488 Update BottomAppBar fab margin to represent the distance between the cutout and the fab rather than twice the distance
PiperOrigin-RevId: 197939692
2018-05-30 17:32:51 -04:00
connieshi
52d2a1de2e Add a ChipGroup.LayoutParams static class that extends from FlexBoxLayout.LayoutParams. Provide the appropriate pass-through constructors for this new class. Override generateLayoutParams/checkLayoutParams/generateDefaultLayoutParams in ChipGroup to check for and return instances of the new ChipGroup.LayoutParams class.
PiperOrigin-RevId: 197933724
2018-05-30 17:32:24 -04:00
dniz
b4529d2a88 Remove unused MathUtils methods and add documentation. Also replace
MathUtils#constrain with Support Library MathUtils#clamp

PiperOrigin-RevId: 197905324
2018-05-30 17:31:27 -04:00
gauthams
cfe88cad74 Fix a long-standing selection bug in TabLayout, where an OnTabSelectedListener onTabUnselected() method would interpret the now-unselected tab as still being selected, resulting in broken behavior where an unselected tab was still being displayed as selected.
PiperOrigin-RevId: 197806355
2018-05-30 17:30:18 -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
dniz
d592999d59 Infer initial lifted state for AppBarLayout lift on scroll. This preserves the app bar's elevation across screen rotations and saving/restoring of instance state.
PiperOrigin-RevId: 197754058
2018-05-30 17:19:08 -04:00
dniz
5885d2954d Fix spacing in AppBarLayout attr comment
PiperOrigin-RevId: 197630608
2018-05-30 17:18:48 -04:00
dniz
49b6f396ba Update AppBarLayout to support lift on scroll behavior
PiperOrigin-RevId: 197607028
2018-05-30 17:17:09 -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
connieshi
a898d12289 Prevent users from setting chip text to appear on multiple lines.
PiperOrigin-RevId: 197134896
2018-05-22 13:57:36 -04:00
dniz
81c4ece8f7 Remove colorPrimaryLight, colorSecondaryLight, and colorSecondaryDark
PiperOrigin-RevId: 197093793
2018-05-22 13:56:47 -04:00
connieshi
7fa43fc8cb Add null check before validating attribute set to avoid NPE.
PiperOrigin-RevId: 197050012
2018-05-17 19:46:17 -04:00
afohrman
1cad4007dc Roll forward box background fix.
PiperOrigin-RevId: 197041463
2018-05-17 19:45:46 -04:00
connieshi
eb89b76787 Prevent user from setting start/end compound drawable on Chips. They should be set via app:chipIcon and app:closeIcon instead.
PiperOrigin-RevId: 197037053
2018-05-17 19:45:00 -04:00
connieshi
8cd8c2ad80 Prevent callers from setting ellipsize to MARQUEE because chip text should not scroll.
If caller sets ellipsize to MARQUEE an UnsupportedOperstaionException will be thrown at runtime.
Override ellipsize getters / setters and pass the value to ChipDrawable.

PiperOrigin-RevId: 196813582
2018-05-16 11:50:05 -04:00
afohrman
4700966a38 Roll back box background changes.
PiperOrigin-RevId: 196762626
2018-05-16 11:49:37 -04:00
afohrman
e566a535ac Ensure box background is drawn behind other text field elements.
This commit:
- Moves the draw calls in TextInputLayout#draw to happen in a better order: now, the background is drawn first, then TextInputLayout and its children, then the hint. This prevents the box from drawing on top of other text field elements.
- Updates box background setters and getters to modify boxBackgroundColor instead of defaultBoxBackgroundColor.
- Adds a demo for filled box background color changes to the text field demo.

PiperOrigin-RevId: 196748102
2018-05-16 11:48:54 -04:00
marianomartin
7aff9d2e8b Snackbar, not animating only when talkback is turned on
PiperOrigin-RevId: 196714687
2018-05-16 11:45:09 -04:00
marianomartin
40c667c24d Annotate setIconSize with @Dimension
PiperOrigin-RevId: 196705264
2018-05-16 11:44:37 -04:00
marianomartin
9d1d6e7bae Add setIconSize to material button
Adding functionality to be able to scale the icon

PiperOrigin-RevId: 196698054
2018-05-16 11:44:12 -04:00