76 Commits

Author SHA1 Message Date
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
cketcham
81e708e1bb Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264745164
2019-08-26 11:19:28 -04:00
cketcham
a1a763dde9 Fixing NavigationView scrims
NavigationView tries to determine if it is behind the status bar by checking if it's at the top of the screen. If it is and there are insets, it will draw a scrim. It also tries to determine if it is under the system nav. If it is and the system nav isn't fully transparent, it will also draw a scrim.

PiperOrigin-RevId: 264167166
2019-08-20 11:13:04 -04:00
cketcham
96117da2db Remove unnecessary @hide
PiperOrigin-RevId: 261971189
2019-08-16 15:26:29 -04:00
cketcham
234aa8535c Fix scrim drawing behind NavigationView when used in a BottomDrawer for full screen activities
PiperOrigin-RevId: 261699505
2019-08-06 14:27:11 -04:00
leticiars
6a88f2b7d7 Adding option to set TextInputLayout icons to be not checkable.
Also updating clear text end icon to be not checkable, so that screen readers don't announce the icon's checked state as it's not relevant (differently from the password toggle icon, for example).

PiperOrigin-RevId: 259532643
2019-07-23 11:14:44 -04:00
dniz
0512f776c5 Remove sub-package AndroidManifest.xml files from lib directory
PiperOrigin-RevId: 258390736
2019-07-16 13:18:32 -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
connieshi
6589e54a47 Publicly expose a hidden setter (ChipGroup#setSingleLine) inherited from a restricted parent class (FlowLayout).
PiperOrigin-RevId: 257046797
2019-07-09 12:59:59 -04:00
marianomartin
a648bac7b2 Merge DrawableUtils classes
PiperOrigin-RevId: 257022779
2019-07-09 12:56:12 -04:00
marianomartin
19aeb9b7a2 Delegate overscrollmode in navigation view to inflated MenuView
PiperOrigin-RevId: 256988688
2019-07-09 12:54:18 -04:00
dniz
5df3bebd63 Update elevation overlays to be based absolute elevation, factoring in the elevation of all parent views
Will follow-up with TabLayout absolute elevation separately

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

PiperOrigin-RevId: 255404830
2019-07-03 13:55:49 -04:00
marianomartin
367b295624 Internal cleanup
PiperOrigin-RevId: 254414602
2019-06-24 17:12:42 -04:00
cketcham
8a2e358f1f Fix issue with insets being overwritten by providing a copy
PiperOrigin-RevId: 253785920
2019-06-18 13:53:14 -04:00
marianomartin
b9147d4f2d Remove some lint warnings from baseline
PiperOrigin-RevId: 253036361
2019-06-18 13:24:50 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
marianomartin
5a5d311a36 Check more lint warnings, show warnings as errors.
PiperOrigin-RevId: 252822573
2019-06-18 13:20:15 -04:00
connieshi
ccc48904e5 Add BadgeDrawable constructor that takes a xml resource.
PiperOrigin-RevId: 252709395
2019-06-18 13:15:07 -04:00
cketcham
1aa7125398 Update BottomAppBar to respect bottom system insets
PiperOrigin-RevId: 252394398
2019-06-18 11:49:00 -04:00
dniz
2ab5bdbf29 Date Picker text field toggle
PiperOrigin-RevId: 251443135
2019-06-10 08:45:32 -07:00
dniz
63c5a54798 Update CheckableImageButton to save instance state
PiperOrigin-RevId: 250929386
2019-06-10 08:23:54 -07:00
connieshi
7a4ecb0392 Update TextDrawableHelper's constructor to take a delegate.
Update ChipDrawable and BadgeDrwable to pass a delegate when they instantiate TextDrawbleHelper.

PiperOrigin-RevId: 245469285
2019-04-29 15:56:31 -07:00
dniz
058ac81494 Add enforceMaterialTheme attr to public.txt
PiperOrigin-RevId: 245308588
2019-04-29 15:46:51 -07:00
dniz
1f244318d8 Add @hide to all @RestrictTo annotations that are missing it
PiperOrigin-RevId: 243646339
2019-04-19 16:29:30 -04:00
Material Design Team
6096d60959 Roll Forward of CL 242858439
PiperOrigin-RevId: 243197143
2019-04-19 15:48:51 -04:00
Material Design Team
3666e15298 Automated g4 rollback of changelist 242858439
PiperOrigin-RevId: 242907738
2019-04-19 15:30:07 -04:00
Material Design Team
3f12bd50e2 Add a itemMaxLines Attribute to NavigationView
Add a itemMaxLines attr to NavigationView and propagate it down to the internal CheckedTextView.

Also, make a slight change to design_navigation_item.xml layout to accommodate multiple lines of text. Without the layout change, the layout_height of the item is set to "?attr/listPreferredItemHeightSmall" so it can't contain an arbitrary number of lines. It can also chop lines in the middle.

To fix this, we change layout_height to "wrap_content" and add a minHeight attribute set to "?attr/listPreferredItemHeightSmall". This results in the same behavior for single line items but expands appropriately to contain items with multiple rows.

PiperOrigin-RevId: 242858439
2019-04-19 15:15:23 -04:00
connieshi
fd2a6f2b6b Add parcelable versions of SparseIntArray and SparseBooleanArray for internal use.
PiperOrigin-RevId: 242675268
2019-04-19 13:18:06 -04:00
afohrman
4476564820 Vertically center the filled text field's expanded label.
PiperOrigin-RevId: 241791031
2019-04-05 15:46:27 -04:00
Material Design Team
41274ddb1f Migrate transition android support libraries to androidx.
PiperOrigin-RevId: 239881112
2019-03-26 17:30:06 -04:00
connieshi
5a9e0d378d Update ChipDrawable to use TextDrawableHelper to handle logic related to text rendering. ChipDrawable is still responsible for drawing text.
PiperOrigin-RevId: 237257476
2019-03-08 10:08:59 -05:00
connieshi
93c5fc737b Add TextDrawableHelper, a class that helps drawables support drawing text.
PiperOrigin-RevId: 235979500
2019-03-08 09:41:15 -05:00
gauthams
1db449c897 Refactor dpToPx method into ViewUtils
PiperOrigin-RevId: 235243747
2019-02-24 14:38:37 -05:00
afohrman
e847a22103 Remove @VisibleForTesting annotation from CollapsingTextHelper#getCurrentCollapsedTextColor.
The annotation was only necessary for the method in TextInputLayout that calls CollapsingTextHelper#getCurrentCollapsedTextColor.

PiperOrigin-RevId: 230616582
2019-01-25 13:57:02 -05:00
dniz
11df79f95c Clean up Gradle build shorthands for appcompat/androidx libraries
PiperOrigin-RevId: 229369959
2019-01-18 14:13:26 -05:00
dniz
03cf027bc7 Deprecate Experimental annotation and remove from Shapes
PiperOrigin-RevId: 229200655
2019-01-18 14:10:16 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
marianomartin
9837721733 Replace circular border drawable with a drawable for any shape.
PiperOrigin-RevId: 224205053
2018-12-06 12:05:36 -05:00
cketcham
3ad01eceda Ignore empty header and dividers when counting the number of items in NavigationView for accessibility
PiperOrigin-RevId: 223407274
2018-12-06 11:39:08 -05:00
ldjesper
831ad7dde7 a11y for selection control touch targets
PiperOrigin-RevId: 222898711
2018-12-06 11:24:17 -05:00
Brian Attwell
483d34a0f4 Don't rebind/relayout/reinflate any views after clicking a menu item
If none of the check state has changed, let's not update the menu. Background for this diff is at #61. While larger improvements may make sense, this diff is designed to mitigate the most serious issue in a way that doesn't create risk.

Test: used these modified classes inside the Android Uber app and ran a profiler. The problematic 50ms delay caused by this bug was fixed. You can see the before/after traces in https://issuetracker.google.com/issues/73723207.

Resolves https://github.com/material-components/material-components-android/issues/61
Resolves https://github.com/material-components/material-components-android/pull/62

GIT_ORIGIN_REV_ID=f8f8488689be67b8974d29e1c623e1dbe18cfdae
PiperOrigin-RevId: 221799350
2018-11-16 12:23:34 -05:00
connieshi
3cc29997ec Removed unused touch target helper classes.
PiperOrigin-RevId: 221318504
2018-11-16 11:37:01 -05:00
dniz
35a0839ad6 Add defStyleRes to materialThemeOverlay wrapping
- Fixes materialThemeOverlay case where client is not using our theme or style (e.g., AppCompat + component with no style set)
- Also refactors createThemedContext() to use obtainStyledAttributes with defStyleAttr and defStyleRes instead of getTheme().resolveAttribute()

PiperOrigin-RevId: 213464594
2018-09-28 14:53:34 -04:00
dniz
dff21575fb Add ContextUtils getActivity() method
PiperOrigin-RevId: 213356904
2018-09-28 14:52:27 -04:00
leticiars
df551410c4 Fixing padding of hint label when there is a leading icon
PiperOrigin-RevId: 213277053
2018-09-28 14:49:23 -04:00
dniz
461101bc5b Fix Gradle build by removing Java 8 method reference
PiperOrigin-RevId: 212685609
2018-09-14 11:00:30 -04:00
cketcham
655b3dc1b0 Add materialThemeOverlay attribute
PiperOrigin-RevId: 212665868
2018-09-14 10:58:21 -04:00
Material Design Team
850795da31 Delegates CollapsingTextHelper text attributes processing to TextAppearance.
This removes duplication between the 2 implementations and automatically fixes font loading bug in CollapsingToolbarLayout & TextInputLayout. It has a side effect of changing font loading from sync to async but it shouldn't affect anyone since font loading wasn't really working in the first place. It may affect the UIs that were affected by the original bug though.

To alleviate possible "font flickering" due to async loading, CollapsingTextHelper defers the TextPaint changes until the font is actually loaded.

Another scenario the async loading would have an impact on is when the font is manually overwritten with CollapsingTextHelper.setTypeface() while async op is still ongoing. The result of async load would then overwrite the font back to the originally requested. This happens in TextInputLayout which overwrites its own font setting to this of its child whenever its added. This may happen before async op completes. To guard against that, any direct font setting automatically cancels the async load (cancels == ignores the result when it comes).

PiperOrigin-RevId: 212328671
2018-09-14 10:53:39 -04:00
Material Design Team
a5d38d43d6 Changes SwitchMaterial coloring to composites instead of blends.
Also provides color layering utilities and removes text color changes.

PiperOrigin-RevId: 211692944
2018-09-07 11:55:28 -04:00
Material Design Team
56ee534de2 Creates and colors SwitchMaterial
PiperOrigin-RevId: 210574240
2018-08-28 16:44:02 -04:00