skydoves / AndroidVeil

:performing_arts: An easy and flexible way to implement loading skeletons and shimmering effects on layouts for Android.
Apache License 2.0
1.52k stars 106 forks source link

Veil Layout attr in XML no longer works #43

Open thiago-youx opened 3 months ago

thiago-youx commented 3 months ago

Please complete the following information:

Describe the Bug: The veil layout used directly in XML no longer works (even on XML preview): app:veilLayout_layout="@layout/skeleton_veil_layout"

Complete XML component:

<com.skydoves.androidveil.VeilLayout
        android:id="@+id/veil_loading"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:veilLayout_baseAlpha="0.8"
        app:veilLayout_baseColor="@color/colorGraySkeleton"
        app:veilLayout_highlightAlpha="1.0"
        app:veilLayout_isPrepared="true"
        app:veilLayout_highlightColor="@color/colorGraySkeleton"
        app:veilLayout_layout="@layout/skeleton_veil_layout"
        app:veilLayout_radius="@dimen/space4dp"
        app:veilLayout_shimmerEnable="true"
        app:veilLayout_veiled="true" />

Now it requires to call setLayout before starting veil:

veilLoading.setLayout(R.layout.skeleton_veil_layout)
veilLoading.veil()

Changing the new feature "veilLayout_isPrepared" value on XML does not resolve this issue.

Expected Behavior: XML display the veil layout on preview and also use it on execution without new method calls.