140 Commits

Author SHA1 Message Date
gauthams
85c2bf1479 Set tab style to .Colored style variant for the dark theme
PiperOrigin-RevId: 186501713
2018-03-12 12:48:09 -04:00
afohrman
e60ff13c1b Add shape and bottomappbar to build.
PiperOrigin-RevId: 186501402
2018-03-12 12:46:29 -04:00
cketcham
9b8f69d5ef Automated g4 rollback of changelist 186476270
PiperOrigin-RevId: 186498341
2018-03-12 12:45:36 -04:00
Material Design Team
8a9e021c44 Automated g4 rollback of changelist 186467179
PiperOrigin-RevId: 186476270
2018-03-12 12:45:14 -04:00
cketcham
b8e1399b6f Add default component style for BottomAppBar
This commit also fixes the style for Dark Theme and adds the BottomAppBar demo to the catalog.

PiperOrigin-RevId: 186467179
2018-03-12 12:44:52 -04:00
afohrman
751e6c1e70 Use design_error instead of error_color_material.
PiperOrigin-RevId: 186458565
2018-03-12 12:44:38 -04:00
afohrman
524e475e05 Set bottom nav style to the .Colored style variant for the dark theme.
PiperOrigin-RevId: 186357811
2018-03-12 12:44:19 -04:00
Material Design Team
bf30083398 Add base style for Bottom Sheets
PiperOrigin-RevId: 186348361
2018-03-12 12:44:05 -04:00
afohrman
9e39c9f06f Set default style for TextInputLayout in constructor.
PiperOrigin-RevId: 186339747
2018-03-12 12:42:42 -04:00
afohrman
e8c48d8692 Add helper text to onPopulateAccessibilityEvent.
And make helper text be read out after the label/hint is read out in TalkBack.

PiperOrigin-RevId: 185995405
2018-03-12 12:42:22 -04:00
dniz
a48c0cb3ba Move lib/AndroidManifest.xml into lib/java/android/support/design
PiperOrigin-RevId: 185918155
2018-03-12 12:42:08 -04:00
afohrman
deb50914cb Support RTL for cutout.
Make the CutoutDrawable draw itself in the correct bounds when in RTL mode. This involves changing CollapsingTextHelper#getCollapsedTextActualBounds to return bounds that account for RTL.

PiperOrigin-RevId: 185916657
2018-03-12 12:41:31 -04:00
afohrman
73338efbe0 Set CutoutDrawable bounds before the first draw.
Set cutout bounds in onLayout to make sure that they're set by the time the first draw happens.  This fixes an issue where the CutoutDrawable was drawn with incorrect bounds if setText was called on the TextInputEditText before it was laid out, by ensuring that the cutout bounds are set before the first draw pass.

PiperOrigin-RevId: 185877643
2018-03-12 12:41:13 -04:00
cketcham
f9e2f23b3c Add BottomDrawer component which allows for easily showing content from the bottom of the screen.
PiperOrigin-RevId: 185863597
2018-03-12 12:40:54 -04:00
dniz
a5848c569e Format default material component styles
PiperOrigin-RevId: 185673907
2018-03-12 12:40:21 -04:00
Material Design Team
c9e56c9959 Create a new default style for NavigationView and move the existing Design style to new package.
PiperOrigin-RevId: 185658659
2018-03-12 12:39:42 -04:00
afohrman
613eaea7be Add icon size attribute and demo to bottom nav.
Adds an itemIconSize attribute, setters, getters, and tests to BottomNavigationView, as well as a Catalog demo for icon size with a slider.

PiperOrigin-RevId: 185609075
2018-03-12 12:39:06 -04:00
afohrman
f3d9a07b1f Add default bottom nav component style attribute in BottomNavigationView constructor.
PiperOrigin-RevId: 185562589
2018-03-12 12:38:48 -04:00
afohrman
490f7f9595 Automated g4 rollback of changelist 185533755
PiperOrigin-RevId: 185543163
2018-03-12 12:38:33 -04:00
afohrman
85952c42a3 Use default style in TIL and bottom nav constructors.
PiperOrigin-RevId: 185533755
2018-03-12 12:38:16 -04:00
dniz
a0e14d8d7c Fix MaterialButton Gradle build
PiperOrigin-RevId: 185464986
2018-03-12 12:37:57 -04:00
markwei
44236706b5 Use app:fontFamily instead of android:fontFamily to support pre-16 devices.
PiperOrigin-RevId: 184906896
2018-03-12 12:37:33 -04:00
gauthams
df0abdb151 Automated g4 rollback of changelist 184658131
PiperOrigin-RevId: 184894533
2018-03-12 12:37:05 -04:00
markwei
62d6866220 Change tonal palette representation in theme from color array, to separate color attributes.
Separate attributes allows components to directly reference a color in the tonal palette in its resources.
Otherwise, the implications of these attributes is the same as the previous color arrays.

PiperOrigin-RevId: 184764971
2018-03-12 12:36:43 -04:00
Material Design Team
0534bfb96a Automated g4 rollback of changelist 184611618
PiperOrigin-RevId: 184658131
2018-03-12 12:35:05 -04:00
gauthams
f602bc975f Update button to support tinting and backwards compatibility with AppCompatButton
PiperOrigin-RevId: 184611618
2018-03-12 12:34:13 -04:00
markwei
84fd72dc03 Rollback changes to BaseTransientBottomBar.
PiperOrigin-RevId: 184595279
2018-03-12 12:33:16 -04:00
dniz
a20a281ffe Revert expandable dependency in widget to be implementation again
PiperOrigin-RevId: 184529100
2018-03-12 12:32:56 -04:00
gauthams
d1c2b6249b Add tabStyle theme attribute for tab layout style
PiperOrigin-RevId: 184359499
2018-03-12 12:32:38 -04:00
dniz
c84e325c0d Make expandable dependency api instead of implementation in widget
PiperOrigin-RevId: 184289220
2018-03-12 12:27:56 -04:00
afohrman
3124f7dc3e Create public_attrs for bottomnavigation.
And add attributes to it.

None of these attributes were in widget's public_attrs, with the exception of menu. I'm not removing menu from widget's public_attrs, since NavigationView also uses that attribute.

Related side note: Before the package migration for bottomnavigation, BottomNavigationView used attributes declared by NavigationView, but for the package move, I made them standalone attributes to avoid creating circular dependencies. After cl/183574402 goes in, I'm going to consider making bottomnavigation depend on navigationview, and using NavigationView's attrs for BottomNavigationView.

PiperOrigin-RevId: 184201928
2018-03-12 12:27:13 -04:00
afohrman
ff91999cd8 Create public_attrs for textfield.
And move attributes from widget's public_attrs to it. Also add some attributes that weren't in public_attrs yet.

PiperOrigin-RevId: 184201597
2018-03-02 15:40:11 -05:00
dniz
d001961fdf Fix ThemeEnforcement Gradle build
PiperOrigin-RevId: 184185845
2018-03-02 15:39:20 -05:00
afohrman
677f4abe84 Invalidate after applying box attributes instead of after assigning them.
Move the call to invalidate() to happen after the box attributes are applied to the text box instead of once the attribute value is assigned to its field. This also required moving the call to applyBoxAttributes() from draw() for performance reasons, since applyBoxAttributes() was asking to be redrawn from inside the draw method.

This fixes the broken change color button in the text fields demo. Before, it only changed the color once drawableStateChanged() was called - now, it changes immediately.

PiperOrigin-RevId: 184138044
2018-03-02 15:38:18 -05:00
markwei
2e2c348e6f Add new enforceMaterialTheme attribute that you can set in any style to denote that the style uses a new attribute that must exist in the app theme.
Update ThemeEnforcement to read this new attribute, and check for Material theme.
Change the ThemeEnforcement API to replace Context#obtainStyledAttributes().

See followup CL for how this attribute is used.

PiperOrigin-RevId: 184074635
2018-03-02 15:36:20 -05:00
gauthams
fa7451003b Remove tabsUnboundedRipple attribute from public_attrs
PiperOrigin-RevId: 184059431
2018-03-02 15:34:47 -05:00
gauthams
caab267a86 Add all new tabs attributes to public_attrs.xml
PiperOrigin-RevId: 184055361
2018-03-02 15:34:17 -05:00
gauthams
809bf757a5 Workaround for tab indicator tinting on API 21
PiperOrigin-RevId: 183910609
2018-03-02 15:32:45 -05:00
gauthams
3c05304f4e Create package for tabs resources.
This commit creates a tabs package for resources related to tabs. It does not move TabLayout to this package, since that would break current users.

PiperOrigin-RevId: 183893754
2018-03-02 15:04:21 -05:00
dniz
c31ef1f1d7 Update Gradle and Maven configurations
PiperOrigin-RevId: 183872033
2018-03-02 14:58:51 -05:00
afohrman
2ee17ed2e5 Parent Theme.Design* with Theme.AppCompat instead of Theme.MaterialComponents.
Previously, Theme.Design inherited from Theme.MaterialComponents, which would have resulted in an automatic update to Theme.MaterialComponents. Now, users will have to opt in to Theme.MaterialComponents to get the new theme.

Also add in DesignTheme attributes that were deleted and attributes that were set in Theme.Design*.

PiperOrigin-RevId: 183716471
2018-03-02 14:58:01 -05:00
afohrman
e889e00bbe Add component style attr for bottom nav.
And set it to the default bottom nav style in the theme.

PiperOrigin-RevId: 183440985
2018-03-02 14:57:15 -05:00
afohrman
8ce02fd5ef Move bottom nav resources to bottomnavigation package.
And update bottomnavigation/build.gradle.

Also removes attribute dependencies on NavigationView, in order to avoid circular dependencies and/or creating a new package for NavigationView.

This is in preparation for adding a component style attr for bottom nav.

PiperOrigin-RevId: 183435857
2018-03-02 14:55:43 -05:00
travisc
74a2daf258 Add custom view inflater class for Material Components.
As of this commit, this is empty, but will be filled out with the various
widget classes in future commits.

PiperOrigin-RevId: 183425311
2018-03-02 14:54:45 -05:00
Yuichi Araki
a9717cf6b8 Fix uses of deprecated API in BottomSheetBehavior
This fixes BottomSheetBehavior implementation and remove uses of
deprecated APIs. The APIs are mainly about nested scrolling related to
inertia scrolling by nested fling.

This CL does not change the behavior. The inertia scrolling by nested
fling is not enabled. For that, we will have to change the way we use
ViewDragHelper, and let nested fling handle the inertia scrolling.

Bug: 70912761
Test: Existing tests (BottomSheetBehaviorTest, BottomSheetDialogTest)
Change-Id: Iaea50056ed253131c7920f703136d30e73918756
PiperOrigin-RevId: 183276945
2018-01-25 18:25:54 -05:00
afohrman
357e2dca90 Make the default TextInputLayout style a base style.
That way, users will have to depend on one of the box styles directly. Before, anyone that used Widget.MaterialComponents.TextInputLayout would have gotten an outline text field, which is not implied by the style name.

This commit also includes a slight reformat to make sure that style items that don't fit on one line are properly formatted.

PiperOrigin-RevId: 183130385
2018-01-25 18:24:50 -05:00
afohrman
cbc5d7fb0e Create component style attribute for text input.
And assign it to the right defaults in the theme.

Since text fields is in the widget package, . I put the attr declaration in widget/../attrs.xml right on top of the theme. If text fields is ever pulled into its own package, this attribute will be moved along with the rest of TextInputLayout's attributes.

PiperOrigin-RevId: 183125979
2018-01-25 18:24:26 -05:00
afohrman
ed039479e5 Create package for text field resources.
This commit creates a textfield package for resources related to text fields. It does not move TextInputLayout to this package, since that would break current users.

There's a small unrelated change included in this move: drawable-v21/design_bottom_navigation_item.xml was not moved along with its compat counterpart when it was moved recently, so I moved it while I was moving things around.

PiperOrigin-RevId: 183101110
2018-01-25 18:23:54 -05:00
gauthams
f93f5abe17 Update chip background and stroke drawing to no longer draw background outside stroke
PiperOrigin-RevId: 183033077
2018-01-25 18:23:20 -05:00
dcarlsson
d2736442f2 Update how MaterialCardView sets the card background.
Provide a materialCardView theme attribute to fix conflicts with the existing cardView
theme attribute.

PiperOrigin-RevId: 183031703
2018-01-25 18:22:32 -05:00