material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.37k stars 3.07k forks source link

[TextInputLayout] startIconDrawable overlaps text #3993

Open IreneKhramova opened 9 months ago

IreneKhramova commented 9 months ago

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

Jacks0N23 commented 2 months ago

Hey, google devs, it's a huge bug!

We cannot update to latest versions unless you fix this. It's ruins some of our screens