mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
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