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
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
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
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
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
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
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
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
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
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
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
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
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
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