connieshi
ffa7b10cae
Add null check in Chip#setupTouchTargetDelegate
...
PiperOrigin-RevId: 206215855
2018-08-02 18:00:36 -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
connieshi
bc6a266edf
Update chip to use textappearance theme attributes, and enforce textappearance check
...
PiperOrigin-RevId: 205120039
2018-07-19 11:03:13 -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
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
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
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
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
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
connieshi
24bd4a9531
Remove Chip method.
...
PiperOrigin-RevId: 201199382
2018-06-20 17:30:21 -04:00
connieshi
00a132b6a0
Remove Chip method.
...
PiperOrigin-RevId: 200735866
2018-06-20 17:27:41 -04:00
connieshi
3f00c13ebe
Fix api issues, defer to TextView to render the chip text and ChipDrawable to render everything else.
...
List of text related attributes/methods supported with this approach:
android:autoLink
android:hint
android:text
android:textAllCaps
android:textAppearance
android:textColor
android:textColorHint
android:textColorLink
android:textIsSelectable
android:textScaleX
android:textSize
android:textStyle
android:typeface
android:fontFamily
Not supported:
android:textColorHighlight
android:textColorLink
PiperOrigin-RevId: 200578044
2018-06-20 17:27:20 -04:00
connieshi
649a13fa2e
Replace calls to deprecated method Chip#getChipText() with its replacement Chip#getText().
...
Replace calls to deprecated Chip#setChipText(...) methods with their replacement Chip#setText...).
PiperOrigin-RevId: 199663849
2018-06-20 17:26:38 -04:00
connieshi
860b04767b
Unwrap mutated drawable (chipIcon and closeIcon) before returning it in the getter.
...
PiperOrigin-RevId: 199636765
2018-06-20 17:25:37 -04:00
connieshi
412ee4c1f1
Add support for tinting the chip icon.
...
PiperOrigin-RevId: 199526967
2018-06-20 17:24:18 -04:00
connieshi
434be9ff15
Restores chip text after it's being cleared by TextView's onRestoreInstanceState, this was causing an clearing the chip text on config change for pre-L devices.
...
PiperOrigin-RevId: 199482051
2018-06-20 17:23:38 -04:00
connieshi
57aeb2b7f8
Android Studio is looking for a "Chip" declare-stylable when trying to determine what attributes are applicable for the "Chip" component. Android Studio doesn't know that "ChipDrawable" is used internally and all attributes to "ChipDrawable" applies.
...
This is preventing completions of attribute names for Chip and the attribute panels shows up empty for Chip.
Rename R.styleable.ChipDrawable to R.styleable.Chip and update ChipDrawable to use it.
AS 3.2 canary > 14 (currently 16) is required to see the attributes in the attribute panel.
PiperOrigin-RevId: 198909123
2018-06-04 10:49:01 -04:00
connieshi
4a7bd84360
Add null check to Chip#setText and ChipDrawable#setText. Set null text to empty string, this is done internally by TextView.
...
Changed Chip#getText and ChipDrawable#getText to be @NotNull
PiperOrigin-RevId: 198868472
2018-06-04 10:48:35 -04:00
afohrman
0518a3d651
Add missing public attributes.
...
Looks like some styles and component style attributes slipped by.
PiperOrigin-RevId: 198762794
2018-05-31 16:35:29 -04:00
connieshi
f35acd8660
Rolling back again because of bad interactions with espresso ViewMatchers.
...
PiperOrigin-RevId: 198709590
2018-05-31 16:31:26 -04:00
connieshi
200fdcb6a2
Rolling forward changes to override Chip#getText() and Chip#setText(CharSequence, BufferType) now that a bug in ChipDrawable#getText has been fixed and internal tests are passing again.
...
PiperOrigin-RevId: 198616302
2018-05-30 17:46:46 -04:00
connieshi
bb8f8388e7
Prevent users from setting the background attribute because Chip manages its own background drawable.
...
Allow setBackground to be called by Chip itself internally to set the background to be chipDrawable or ripple.
PiperOrigin-RevId: 198572908
2018-05-30 17:43:30 -04:00
marianomartin
663fd7abff
add res-public files
...
PiperOrigin-RevId: 198567215
2018-05-30 17:42:48 -04:00
connieshi
77f4a89f73
Automated g4 rollback of changelist 198434516
...
PiperOrigin-RevId: 198449773
2018-05-30 17:41:19 -04:00
connieshi
5acdd69431
Prevent users from setting the background attribute because Chip manages its own background drawable.
...
PiperOrigin-RevId: 198434516
2018-05-30 17:40:14 -04:00
connieshi
de67e0d8ea
Keep reference to user provided value in ChipDrawable#setText and return it in ChipDrawable#getText.
...
Currently when a user specifies an instance of java.lang.String to ChipDrawable#setText, ChipDrawable#getText incorrectly returns an instance of android.text.SpannableStringBuilder.
PiperOrigin-RevId: 198393803
2018-05-30 17:37:23 -04:00
connieshi
9492832207
Rolling back changes to override Chip#setText and Chip#getText because it broke some tests.
...
PiperOrigin-RevId: 197975319
2018-05-30 17:34:46 -04:00
connieshi
e3303db70c
Override Chip#getText() to return the internal chip text value via chipDrawable#getChipText.
...
Override Chip#setText(CharSequence, BufferType) to set the value on the internal chip text and prevent text from being set on Chip's super class because ChipDrawable will handle text rendering.
- This method is called by all overridden versions of TextView#setText except android.widget.TextView#setText(char[], int, int)}, which cannot be overridden. This is not ideal but an incremental change towards supporting all flavors of android.widget.TextView#setText methods.
Deprecate Chip#setChipTextResource(int) and Chip#setText(CharSequence)
PiperOrigin-RevId: 197960701
2018-05-30 17:34:04 -04:00
connieshi
2072f7af4d
Rename ChipDrawable#getChipText to ChipDrawable#ChipDrawable#getText
...
Rename ChipDrawable#setChipTextResource to ChipDrawable#setTextResource
Rename ChipDrawable#setChipText to ChipDrawable#setText.
PiperOrigin-RevId: 197948000
2018-05-30 17:33:30 -04:00
connieshi
52d2a1de2e
Add a ChipGroup.LayoutParams static class that extends from FlexBoxLayout.LayoutParams. Provide the appropriate pass-through constructors for this new class. Override generateLayoutParams/checkLayoutParams/generateDefaultLayoutParams in ChipGroup to check for and return instances of the new ChipGroup.LayoutParams class.
...
PiperOrigin-RevId: 197933724
2018-05-30 17:32:24 -04:00
connieshi
a71326896a
Use the android:text attribute instead of chipText attribute to specify text label for ChipDrawable.
...
This is one in a series of planned changes that aim to delegate rendering a Chip's text to TextView instead of ChipDrawable.
PiperOrigin-RevId: 197780081
2018-05-30 17:19:38 -04:00
connieshi
a898d12289
Prevent users from setting chip text to appear on multiple lines.
...
PiperOrigin-RevId: 197134896
2018-05-22 13:57:36 -04:00
connieshi
7fa43fc8cb
Add null check before validating attribute set to avoid NPE.
...
PiperOrigin-RevId: 197050012
2018-05-17 19:46:17 -04:00
connieshi
eb89b76787
Prevent user from setting start/end compound drawable on Chips. They should be set via app:chipIcon and app:closeIcon instead.
...
PiperOrigin-RevId: 197037053
2018-05-17 19:45:00 -04:00
connieshi
8cd8c2ad80
Prevent callers from setting ellipsize to MARQUEE because chip text should not scroll.
...
If caller sets ellipsize to MARQUEE an UnsupportedOperstaionException will be thrown at runtime.
Override ellipsize getters / setters and pass the value to ChipDrawable.
PiperOrigin-RevId: 196813582
2018-05-16 11:50:05 -04:00
connieshi
56b6432e37
Add support to ellipsize chip text.
...
When converting float to int value for intrinsic width, round instead of cast.
Round float values When determining whether text needs to be clipped to avoid overly aggressive clipping (and ellipsizing).
Rewrote layout for the chip example in demo app due to a known GridLayout.
PiperOrigin-RevId: 195957006
2018-05-09 13:39:23 -04:00
Material Design Team
79bf9d0e8e
Support Chip text with TalkBack on older API levels
...
PiperOrigin-RevId: 195430570
2018-05-04 13:58:18 -04:00
Material Design Team
b63a63e853
Allow custom text to be set for a Chip's closeIcon's contentDescription.
...
PiperOrigin-RevId: 195410650
2018-05-04 12:26:52 -04:00
connieshi
0eb5c1ae75
Fix typo in ChipDrawable documentation s/getIntrinsicWidth/getIntrinsicHeight
...
PiperOrigin-RevId: 193965067
2018-04-30 11:56:45 -04:00
cketcham
eb894ea951
Add work around for Chip accessibility focus bug
...
PiperOrigin-RevId: 193951526
2018-04-30 11:42:16 -04:00
cketcham
42144f3a7e
Fix implementation of ExploreByTouchHelper for chips.
...
There is still a bug in ExploreByTouchHelper which will prevent accessibility focus again after the first time a chip gets focus.
PiperOrigin-RevId: 193393825
2018-04-30 11:31:25 -04:00
dniz
9ca33544ac
Update package name to com.google.android.material
...
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00