android/kotlin : Material Button show a grey box and then the box disappear

213 views Asked by At

short clip of the issue

In the clip above you will be able to see the problem better. Switching between Fragments user can see on the icon on the material button a grey box shaped element for short time.

I tried using both the emulator and a real device. Since im using Lottie in my project, custom made svg imported icons it started.. I think I am not quite sure what causing this.

<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="14dp"
android:clickable="true"
app:cardCornerRadius="4dp"
app:cardElevation="8dp">
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/imageViewWorkout"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:src="@drawable/ic_training_arm" />
    <TextView
        android:id="@+id/workoutDate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="14dp"
        android:layout_toEndOf="@id/imageViewWorkout"
        android:text="workout date"
        android:textSize="16sp"
        android:visibility="gone" />
    <TextView
        android:id="@+id/workoutName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="14dp"
        android:layout_toEndOf="@id/imageViewWorkout"
        android:layout_toRightOf="@id/workoutCalories"
        android:text="workout name"
        android:textSize="16sp" />
    <TextView
        android:id="@+id/workoutCalories"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/workoutName"
        android:layout_marginStart="14dp"
        android:layout_toEndOf="@id/imageViewWorkout"
        android:text="workout calories"
        android:visibility="gone" />
    <com.google.android.material.button.MaterialButton
        android:id="@+id/deleteButton"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:layout_below="@id/workoutName"
        android:layout_alignParentRight="true"
        android:background="@drawable/delete_foreground" />
    <com.google.android.material.button.MaterialButton
        android:id="@+id/editButton"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:layout_alignParentRight="true"
        android:layout_toStartOf="@id/deleteButton"
        android:background="@drawable/edit_foreground" />
</RelativeLayout>

</com.google.android.material.card.MaterialCardView>

0

There are 0 answers