material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[TextInputLayout] startIconDrawable overlaps text

Open IreneKhramova opened this issue 1 year ago • 1 comments
trafficstars

Description: startIconDrawable in TextInputLayout in RecyclerView.ViewHolder overlaps text if item does not fit on the screen without scroll (ViewHolder is created later, not when screen is just opened). Text is displayed correctly after scroll to top or after minimizing the app.

Expected behavior: startIconDrawable does not overlap text

Source code:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/textInputLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="16dp"
    android:layout_marginTop="16dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:startIconDrawable="@drawable/ic_check">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/editText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:text="Test text" />

</com.google.android.material.textfield.TextInputLayout>

Minimal sample app repro: https://github.com/IreneKhramova/start-icon-issue

Android API version: API 29

Material Library version: 1.11.0+

Device: Honor 20 pro

https://github.com/material-components/material-components-android/assets/22375303/85085fd0-2016-4c01-9cce-2bfaf1d75a18

IreneKhramova avatar Jan 18 '24 11:01 IreneKhramova