8 Commits

Author SHA1 Message Date
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
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
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
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
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
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00