ldjesper
294f12498d
Rename setCornerRadius to setAllCornerSizes
...
PiperOrigin-RevId: 272959729
2019-10-04 20:08:43 -04:00
connieshi
c1c55475f3
Suppress ClickableViewAccessibility lint error in Chip#onTouchEvent.
...
PiperOrigin-RevId: 271128148
2019-09-26 17:55:16 -04:00
connieshi
461e7f9be8
Remove obsolete todo.
...
PiperOrigin-RevId: 268932308
2019-09-18 14:07:33 -04:00
connieshi
a6106e12b2
When a chip's close icon is purely decorative (i.e. no onCloseIconClickLisetener is set), avoid setting custom accessibility delegate.
...
PiperOrigin-RevId: 268904579
2019-09-18 14:03:37 -04:00
marianomartin
215a839598
Internal cleanup
...
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
7bb525ff59
Update usages of ShapeAppearanceModel to use Builder pattern
...
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
marianomartin
0d4515cb46
Internal cleanup
...
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
Material Design Team
79953b02e3
if we don't set anything, talkback will announce it as checkbox because this class extends AppCompatCheckBox. This fix set the class name to be generic android view so nothing is announced if view is not checkable or clickable
...
PiperOrigin-RevId: 265746456
2019-08-29 12:19:52 -04:00
cketcham
3021dc0ac8
Add @NonNull and @Nullable annotations
...
PiperOrigin-RevId: 264856214
2019-08-26 11:41:00 -04:00
connieshi
238fad4560
Update Chip's AccessibilityDelegate to avoid setting classname /type description when chip is not clickable or checkable.
...
PiperOrigin-RevId: 264676607
2019-08-26 11:12:38 -04:00
connieshi
a6f066c0bf
Chip is an unsupported item type according to Accessibility Scanner.
...
Set the class name on chip's AccessibilityNodeInfo as either android.widget.Button or android.widget.CompoundButton depending on whether chip is checkable.
PiperOrigin-RevId: 263424377
2019-08-16 16:12:47 -04:00
dniz
cc73c2a630
Update TODOs
...
PiperOrigin-RevId: 259535844
2019-07-23 11:21:39 -04:00
marianomartin
0a5d66ffc0
Internal cleanup
...
PiperOrigin-RevId: 257802841
2019-07-15 19:07:26 -04:00
marianomartin
164bf0fabd
Internal cleanup
...
PiperOrigin-RevId: 255609320
2019-07-03 14:02:53 -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
isabellekim
bee37933f4
Update chips to support state_checkable.
...
PiperOrigin-RevId: 255186618
2019-06-26 11:22:10 -04:00
isabellekim
b857c791f9
Change ripples on Chip to use the alphas provided in the ColorStateList.
...
RippleDrawable on different API levels will modulate the alphas differently
for the pressed / focused / hovered states. Therefore, in order to get the
desired alphas for pressed / focused / hovered states, we are using the
mtrl_low_ripple_(pressed|focused|hovered|default)_alpha values which have
been defined to account for the different implementations of RippleDrawable.
PiperOrigin-RevId: 254737730
2019-06-24 17:27:42 -04:00
marianomartin
367b295624
Internal cleanup
...
PiperOrigin-RevId: 254414602
2019-06-24 17:12:42 -04:00
connieshi
8c0f6f72c9
Call ChipDrawable#setShouldDrawText(false) inside Chip#setChipDrawable.
...
PiperOrigin-RevId: 253459599
2019-06-18 13:35:22 -04:00
Material Design Team
0aabd7848e
Automated g4 rollback of changelist 253229141
...
PiperOrigin-RevId: 253254250
2019-06-18 13:33:28 -04:00
Material Design Team
4c22b59c63
Cleanup for focus handing in Chips
...
PiperOrigin-RevId: 253229141
2019-06-18 13:27:43 -04:00
marianomartin
455ba2557b
Internal cleanup
...
PiperOrigin-RevId: 249490219
2019-05-24 14:22:06 -04:00
connieshi
462150b039
Update javadoc of Chip#ensureAccessibleTouchTarget(int) to describe the return value.
...
PiperOrigin-RevId: 248146423
2019-05-16 12:50:54 -04:00
Material Design Team
0a09c19dc6
Fix input focus handling inside Chips.
...
PiperOrigin-RevId: 246850628
2019-05-06 19:22:53 -04:00
connieshi
e6f429fe75
Fix bug that ignored Chip#setEnsureMinTouchTargetAttribute(false) once Chip#setEnsureMinTouchTargetAttribute(true) has been called.
...
Ensure chip width also meets the min touch target size.
PiperOrigin-RevId: 240679599
2019-04-05 15:17:59 -04:00
marianomartin
05bc55723a
Add a way to disable min touch target size in fab
...
PiperOrigin-RevId: 239395098
2019-03-22 17:00:43 -04:00
dniz
833258417d
Add @RequiresApi(VERSION_CODES.LOLLIPOP) to overriden setElevation() methods
...
that call super.setElevation()
PiperOrigin-RevId: 239171863
2019-03-22 16:50:21 -04:00
connieshi
6ebcd6416a
Elevation overlay support for chip.
...
PiperOrigin-RevId: 239029411
2019-03-22 16:30:10 -04:00
afohrman
ca07e5f616
Create OnChangedListener to respond to ShapeAppearanceModel changes and Shapeable interface, and implement it in Chip.
...
The OnChangedListener provides a callback that MaterialShapeDrawables can use to invalidate themselves when the associated ShapeAppearanceModel changes. This allows for modifying the ShapeAppearanceModel through the get/setShapeAppearance methods that the Shapeable interface exposes without having to update the client to redraw itself.
PiperOrigin-RevId: 238703600
2019-03-22 16:16:23 -04:00
gauthams
1db449c897
Refactor dpToPx method into ViewUtils
...
PiperOrigin-RevId: 235243747
2019-02-24 14:38:37 -05:00
connieshi
b641bf706f
Avoid infinite loop in Chip#SetLayoutDirection.
...
PiperOrigin-RevId: 234604880
2019-02-24 14:22:05 -05:00
Material Design Team
a0ab1c29a3
Update Chip padding on RTL properties change
...
Prior to this change, when setLayoutDirection is called on a parent/ancestor View of a Chip, the updated layout direction could be propagated to the Chip without updating its text padding. This change forces a padding update whenever layout direction changes.
PiperOrigin-RevId: 230933347
2019-01-25 15:22:40 -05:00
connieshi
50d133ef03
Update chip to support dynamically changing texts in RTL layout.
...
PiperOrigin-RevId: 226174458
2018-12-21 11:24:38 -05:00
connieshi
3d23dbeac2
Fix logic to delegate text rendering to ChipDrawable instead of Chip.
...
Delegating text rendering to ChipDrawable breaks the api contract so this is for testing purposes only.
PiperOrigin-RevId: 226001080
2018-12-21 11:15:02 -05:00
cketcham
dc72aaeed4
Migrate Gradle build and sources to androidx
...
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
connieshi
9b1f8478e5
Remove chipTouchTargetDelegate attribute.
...
PiperOrigin-RevId: 222298640
2018-12-06 11:16:48 -05:00
connieshi
9fd32f61c3
Log warning instead of UnsupportedOperationException when chip#setBackground and related methods are called.
...
PiperOrigin-RevId: 221665841
2018-11-16 12:18:15 -05:00
connieshi
c13949593f
Add getter/setter for custom chip attribute "ensureMinTouchTargetSize".
...
PiperOrigin-RevId: 221145735
2018-11-16 11:28:10 -05:00
connieshi
60d1dfac70
Update chipDrawable to be wrapped by InsetDrawable (if needed) to ensure it meets Android's recommended minimum touch target size.
...
Update demo catalog app.
PiperOrigin-RevId: 220370443
2018-11-16 10:57:34 -05:00
connieshi
f219705bb6
Add javadoc to chip getters and setters.
...
PiperOrigin-RevId: 219793479
2018-11-16 10:37:15 -05:00
connieshi
b888d9620b
Support shape theming in Chip component.
...
PiperOrigin-RevId: 219373344
2018-11-01 16:16:14 -07:00
marianomartin
9e36c150c0
Fix most javadocs errors
...
PiperOrigin-RevId: 216697274
2018-10-11 18:24:53 -04:00
connieshi
f3a95d09fe
Avoid constantly invalidating ChipDrawable when used in standalone mode.
...
Created TextAppearanceFontCallback (a fork of FontCallback) in order to pass parameter indicating whether font was resolved synchronously.
PiperOrigin-RevId: 216566240
2018-10-11 18:21:33 -04:00
connieshi
b6e96bf4d0
To avoid extra memory allocation, only run workaround for a framework bug that doesn't support themed color referenced in ColorStateList for API level < 23 when the Android version is pre-API 23.
...
Add test for setting a chip's text color to a CSL that references a themed color.
PiperOrigin-RevId: 212871700
2018-09-14 11:03:34 -04:00
connieshi
f64b2fb3c7
Automated g4 rollback of changelist 212803097
...
PiperOrigin-RevId: 212821631
2018-09-14 11:02:38 -04:00
connieshi
5b701669ac
Reuse text color from ChipDrawable#getTextAppearance instead of using additional resources to refetch it.
...
PiperOrigin-RevId: 212803097
2018-09-14 11:02:17 -04:00
dniz
02382c612a
Update Chip to use compat setLayoutDirection() method
...
PiperOrigin-RevId: 212680124
2018-09-14 10:59:52 -04:00
connieshi
d796149d25
Update chip to use themed color attributes.
...
PiperOrigin-RevId: 212104772
2018-09-14 10:51:49 -04:00
connieshi
bf33b9e4e7
Override onInitializeAccessibilityNodeInfo to explicitly tell the AccessibilityInfoNode whether a chip is checkable or clickable.
...
Avoid setting custom ExploreByTouchHelper as delegate in pre-N unless there's a close/trailing icon. This is necessary to workaround a Talkback bug.
PiperOrigin-RevId: 211490101
2018-09-07 11:49:26 -04:00
Material Design Team
b0a9ff6658
Add an override to setLayoutDirection from the parent text view of chips.
...
Setting layoutDirection on TextViews to the direction of the View locale is necessary to ensure that text on chips is rendered correctly in RTL mode. Previously, it would default to LTR mode and then not get set with proper paddings until you interact with a chip to invalidate the layout.
Before (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_before.mp4
After (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_after.mp4
Verified no changes to LTR.
PiperOrigin-RevId: 210560864
2018-08-28 16:43:46 -04:00