317 Commits

Author SHA1 Message Date
Material Design Team
ee9e754c0a Removed unnecessary complexity
PiperOrigin-RevId: 206320111
2018-08-02 18:02:23 -07:00
cketcham
4f7cf963c4 Automated g4 rollback of changelist 206313825
PiperOrigin-RevId: 206319662
2018-08-02 18:02:01 -07:00
dniz
979e577681 Consume all Snackbar touches with OnTouchListener
PiperOrigin-RevId: 206316703
2018-08-02 18:01:36 -07:00
cketcham
6f714ecc4f Update ThemeEnforcement context to read only the android:theme attribute from the style
PiperOrigin-RevId: 206313825
2018-08-02 18:01:03 -07:00
connieshi
ffa7b10cae Add null check in Chip#setupTouchTargetDelegate
PiperOrigin-RevId: 206215855
2018-08-02 18:00:36 -07:00
cketcham
d1e9dd6427 Fix method name referenced in comment
PiperOrigin-RevId: 206206294
2018-08-02 18:00:12 -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
cketcham
40696b02b7 Fix jagged edges on cutout for BottomAppBar
PiperOrigin-RevId: 206194466
2018-08-02 17:57:09 -07:00
Material Design Team
4983b60975 Fix potential bug with shared pointF
PiperOrigin-RevId: 206128392
2018-08-02 17:55:02 -07:00
cketcham
7487a539f7 Add support for ThemeOverlays with the default style attr in MaterialCardView and TextInputLayout
PiperOrigin-RevId: 206004683
2018-08-02 17:54:28 -07:00
dniz
fa9d470741 Fix Snackbar issue where touches are not consumed for non-a11y users and add dismiss action for a11y users
PiperOrigin-RevId: 205450300
2018-07-20 18:27:32 -04:00
cketcham
018b3825c7 Fix buttons for dialog themes
PiperOrigin-RevId: 205300861
2018-07-19 17:28:27 -04:00
connieshi
bc6a266edf Update chip to use textappearance theme attributes, and enforce textappearance check
PiperOrigin-RevId: 205120039
2018-07-19 11:03:13 -04:00
marianomartin
4088fdb1ed Implement getConstantState in CircularBorderDrawable
This fixes a crash on FloatingActionButtonLollipop when it tries to set the background. It calls mutate which calls it on this drawable. Which calls getConstantState().newDrawable()

PiperOrigin-RevId: 205108784
2018-07-19 11:02:32 -04:00
gauthams
2cf1040ca8 Add bridge themes for Material Components
PiperOrigin-RevId: 204852599
2018-07-17 18:11:24 -04:00
marianomartin
f777c67633 Override snackbar duration for touch exploration
Show the Snackbar for indefinite time if touch exploration is enabled and it has an action.
Also make focusable instead of clickable so it doesn't read double tap to interact

PiperOrigin-RevId: 204821491
2018-07-17 18:10:38 -04:00
connieshi
a4292a11de Always compute layout width / height and call setMeasuredDimension even when there are no children instead of delegating to View (which was erroneously setting the height to take up all available space).
This fixes a bug that causes the chipgroup to erroneously takeover the entire height of the screen.

PiperOrigin-RevId: 204810068
2018-07-17 18:10:11 -04:00
marianomartin
ba696b6984 Verify typography subsystem is complete for Bottom Navigation
PiperOrigin-RevId: 204798141
2018-07-17 18:09:19 -04:00
afohrman
5b2d4d667a Allow bottom nav items to gain focus on keyboard traversal.
Set the bottom nav items to always be focusable. This addresses a bug in which bottom nav items didn't gain focus by keyboard pre-O.

PiperOrigin-RevId: 204518309
2018-07-17 18:08:53 -04:00
connieshi
36c01edeb2 Switch ChipGroup to inherit from FlowLayout.
PiperOrigin-RevId: 204296714
2018-07-12 16:18:34 -04:00
connieshi
3705f84c2e Stop explicitly setting ImportantForAccessibility to be true because:
1) It's no longer necessary because Chip extends AppCompatCheckbox and TextView sets this if it's not explicitly set by the user
    2) This prevents developers from indicating that a chip should not be exposed to accessibility.

PiperOrigin-RevId: 204189419
2018-07-12 16:18:20 -04:00
cketcham
e22213ba58 Automated g4 rollback of changelist 204005581
PiperOrigin-RevId: 204142484
2018-07-11 15:22:03 -04:00
Material Design Team
8624748ed8 Use getText() in ChipTouchHelper for consistency
PiperOrigin-RevId: 204138629
2018-07-11 15:21:45 -04:00
connieshi
602a9b63a4 Switch ChipGroup to inherit from FlowLayout.
PiperOrigin-RevId: 204005581
2018-07-11 15:17:56 -04:00
cketcham
2cb77c9331 Update Snackbar documentation to include LENGTH_INDEFINITE
PiperOrigin-RevId: 203952007
2018-07-11 15:17:32 -04:00
connieshi
662aa06b77 Add null check before access attribute set.
PiperOrigin-RevId: 203830200
2018-07-11 15:17:15 -04:00
cketcham
ad1d5f2614 Use ViewCompat.getPaddingEnd() instead of getPaddingEnd for backwards compatibility in Chip
PiperOrigin-RevId: 203812719
2018-07-09 17:27:17 -04:00
connieshi
84c6020605 Check if a user explicitly set any of the deprecated xml attributes but not the updated counterparts:
chipIconEnabled vs. chipIconVisible
    closeIconEnabled vs. closeIconVisible
    checkedIconEnabled vs. checkedIconVisible

PiperOrigin-RevId: 203804667
2018-07-09 15:01:40 -04:00
afohrman
631301e4b1 Update outline box to take on the counter overflow color when overflowed.
PiperOrigin-RevId: 203775391
2018-07-09 15:01:23 -04:00
connieshi
aedfc1cf7c Prevent users from setting the gravity on chips, chip text must be vertically center and start aligned.
PiperOrigin-RevId: 203767756
2018-07-09 15:00:54 -04:00
afohrman
61672b79a4 Remove prefixes from variables in TextInputLayout.
mHelperTextAppearance and mErrorTextAppearance slipped by when the fields were changed.

PiperOrigin-RevId: 203173302
2018-07-09 15:00:21 -04:00
gauthams
fb148f47a4 Use onDraw() instead of draw() in MaterialButton
PiperOrigin-RevId: 203012234
2018-07-09 14:59:09 -04:00
marianomartin
8aa6261493 Icon only buttons
PiperOrigin-RevId: 202660201
2018-07-02 09:51:34 -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
dniz
7cd55d872b Add Toolbar styles that use themed text appearances based on type scale
PiperOrigin-RevId: 202636817
2018-07-02 09:50:23 -04:00
gauthams
58df7b8baa Fixing MaterialButton padding API surface
PiperOrigin-RevId: 202584064
2018-07-02 09:49:33 -04:00
dniz
21dff0f641 Update MaterialComponents Snackbar to use themed text appearance
PiperOrigin-RevId: 202532773
2018-07-02 09:47:41 -04:00
gauthams
8cbde4c219 Update tabs to use type scale attributes, and enforce textAppearance check
PiperOrigin-RevId: 202501993
2018-07-02 09:46:58 -04:00
dniz
24867f367c Fix error in Gradle build due to TextAppearance variable scope
PiperOrigin-RevId: 202488746
2018-07-02 09:46:29 -04:00
gauthams
98350d8bdf Update TextAppearance enforcement error to be more clear.
PiperOrigin-RevId: 202189106
2018-07-02 09:43:00 -04:00
dniz
b30c567719 AppBarLayout expose setLiftable() and setLifted() as a workaround for ListView lift on scroll
Example of workaround:

  appBarLayout.setLiftable(true);
  listView.setOnScrollListener(
      new OnScrollListener() {
        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {}

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
          boolean isAtTop = firstVisibleItem == 0 && (view.getChildCount() == 0 || view.getChildAt(0).getTop() == 0);
          appBarLayout.setLifted(!isAtTop);
        }
      });

PiperOrigin-RevId: 202187470
2018-07-02 09:42:27 -04:00
dniz
b1a784ce75 Implement new Material Snackbar according to spec
This commit updates MaterialComponents Snackbars to have margins and rounded corners, as well as makes Snackbars styleable at the app theme level via a snackbarStyle attribute.

PiperOrigin-RevId: 202141103
2018-07-02 09:41:41 -04:00
connieshi
608d2b2fd7 Add support for android:maxWidth to ChipDrawable. Restrict the intrinsic width of the ChipDrawable by the max width. Fixes bug that ignored maxWidth set in Chip.
PiperOrigin-RevId: 202048514
2018-07-02 09:40:13 -04:00
gauthams
c852e7f0cf Make ThemeEnforcement TextAppearance check more robust
PiperOrigin-RevId: 202039029
2018-07-02 09:39:28 -04:00
connieshi
d584f91ccc Resolve fonts asynchronously to avoid ANR.
Added flag to specify that fonts should be resolved synchronously for instrumentation tests.

PiperOrigin-RevId: 202033678
2018-07-02 09:37:14 -04:00
cketcham
8f7dc21a27 Add android:fontFamily to all text styles
This lets us support clients who can't or don't need to use AppCompatTextView. Using `android:fontFamily` will work for clients with min sdk >= 16.

PiperOrigin-RevId: 202032242
2018-07-02 09:26:47 -04:00
Andhie Wong
e1c8886c6c [AppBar] appbar_scrolling_view_behavior as public res
PiperOrigin-RevId: 201416419
2018-06-20 17:30:59 -04:00
connieshi
24bd4a9531 Remove Chip method.
PiperOrigin-RevId: 201199382
2018-06-20 17:30:21 -04:00
cketcham
841ba156fc Automated g4 rollback of changelist 199530791
PiperOrigin-RevId: 201188669
2018-06-20 17:29:57 -04:00
gauthams
580f63bd4d Remove unused ThemeEnforcement method
PiperOrigin-RevId: 201101785
2018-06-20 17:29:16 -04:00