team-supercharge / ShimmerLayout

DEPRECATED - Memory efficient shimmering effect for Android applications by Supercharge.
Apache License 2.0
2.51k stars 282 forks source link

Shimmer effect moving out from view sometimes #69

Open MenosGrante opened 5 years ago

MenosGrante commented 5 years ago

Sometimes shimmer effect moving out of views and after restart it is working good again.

Video example

<io.supercharge.shimmerlayout.ShimmerLayout
        android:id="@+id/statisticsLayoutLoading"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        app:shimmer_angle="15"
        app:shimmer_color="@color/colorShimmerEffect">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <View
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_margin="16dp"
                android:background="@color/colorShimmerBackground" />

            <View
                android:layout_width="280dp"
                android:layout_height="280dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="16dp"
                android:layout_marginBottom="16dp"
                android:background="@drawable/figure_circle"
                android:backgroundTint="@color/colorShimmerBackground" />

            <View
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_margin="16dp"
                android:background="@color/colorShimmerBackground" />

            <View
                android:layout_width="280dp"
                android:layout_height="280dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="16dp"
                android:layout_marginBottom="16dp"
                android:background="@drawable/figure_circle"
                android:backgroundTint="@color/colorShimmerBackground" />

            <View
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_margin="16dp"
                android:background="@color/colorShimmerBackground" />

            <View
                android:layout_width="280dp"
                android:layout_height="280dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="16dp"
                android:layout_marginBottom="16dp"
                android:background="@drawable/figure_circle"
                android:backgroundTint="@color/colorShimmerBackground" />
        </LinearLayout>
    </io.supercharge.shimmerlayout.ShimmerLayout>
veghtomi commented 5 years ago

@MenosGrante thanks for reporting the, I will investigate it.

MenosGrante commented 5 years ago

@veghtomi No problem, hope you will fix this soon :)

DanP1925 commented 5 years ago

@veghtomi did you find the cause of this issue because I'm having it too on my app

Sdghasemi commented 5 years ago

Any updates on this?

nikhilpanju commented 5 years ago

Same issue here. Any updates @veghtomi ?

atakankaya commented 5 years ago

I am also seeing this behaviour, and I notice that this happens with phones running Android 9. I see that 2-3 out of 10 cycles go beyond the bounds on Samsung S9. Issue does not happen on Huawei P9 Lite (Android 7.0) or Samsung Tab S2 (Android 7.0)

Do you have any updates regarding this @veghtomi ?

fenghuilu commented 2 years ago
private void enableForcedSoftwareLayerIfNeeded() {

// if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) { setLayerType(View.LAYER_TYPE_SOFTWARE, null); // } } can ignore this problem