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
Created TextAppearanceFontCallback (a fork of FontCallback) in order to pass parameter indicating whether font was resolved synchronously.
PiperOrigin-RevId: 216566240
The previous code was setting total padding (both start & end) as just end padding of the parent TextView and relying on the invalidation phase drawing the text in the correct place by shifting canvas with computed offset of start padding. This is risky as Chip may be just re-laid without actually invalidating it and render wrong paddings. Also RTL layout direction is incorrectly identified as LTR during layout sometimes, which makes the text being rendered with incorrect offset.
This change sets the paddings correctly removing the need of manual offsetting during onDraw() and relies purely on TextView for its text rendering.
PiperOrigin-RevId: 210042249
Remove overridden getText method, and rely on the TextView's implementation.
This also fixes accessibility issues when Talkback granularity is set to "word" or "characters".
PiperOrigin-RevId: 207296625
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
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
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
Rename ChipDrawable#setChipTextResource to ChipDrawable#setTextResource
Rename ChipDrawable#setChipText to ChipDrawable#setText.
PiperOrigin-RevId: 197948000
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