Create base classes for text field demos to unify shared logic and handle optionally controllable text field demos. This new structure is used to split the text field demo into filled and outline controllable demos.
This commit also contains some cleanup for text field demos in general (removes an extra string, converts anonymous listeners to lambdas, etc.)
PiperOrigin-RevId: 196999248
This commit:
- Moves the draw calls in TextInputLayout#draw to happen in a better order: now, the background is drawn first, then TextInputLayout and its children, then the hint. This prevents the box from drawing on top of other text field elements.
- Updates box background setters and getters to modify boxBackgroundColor instead of defaultBoxBackgroundColor.
- Adds a demo for filled box background color changes to the text field demo.
PiperOrigin-RevId: 196748102
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