Android TextInputLayout PasswordToggle Not Working

I am having a trouble displaying the password using app:passwordToggleEnabled="true". I am using Material Design, I have dependencies of support:design and material design, I even tried endIcon password_toggle. But when I click to the toggle button it simply does not work.

My Layout is below:

<com.google.android.material.textfield.TextInputLayout
            android:id="@+id/loginPasswordLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
            app:boxStrokeColor="@color/black"
            app:hintTextColor="@color/black"
            app:boxStrokeWidthFocused="2dp"
            android:hint="@string/password"
            app:startIconDrawable="@drawable/lock_2"
            app:startIconTint="@color/black"
            app:passwordToggleEnabled="true"
            app:passwordToggleTint="@color/black">
            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginRight="10dp"
                android:layout_marginLeft="10dp"
                android:elevation="20dp"
                android:background="@color/transparentWhite"
                android:inputType="textPassword"
                android:ems="15"/>
        </com.google.android.material.textfield.TextInputLayout>

Thank you.

Answer

android:elevation attribute is not suitable for TextInputEditText and you need to remove it and it will work.

After removing android:elevation="20dp"

<com.google.android.material.textfield.TextInputLayout
        android:id="@+id/loginPasswordLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
        app:boxStrokeColor="@color/black"
        app:hintTextColor="@color/black"
        app:boxStrokeWidthFocused="2dp"
        android:hint="@string/password"
        app:startIconDrawable="@drawable/lock_2"
        app:startIconTint="@color/black"
        app:passwordToggleEnabled="true"
        app:passwordToggleTint="@color/black">
        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginRight="10dp"
            android:layout_marginLeft="10dp"
            android:background="@color/transparentWhite"
            android:inputType="textPassword"
            android:ems="15"/>
</com.google.android.material.textfield.TextInputLayout>