Memory efficient shimmering effect for Android applications by Supercharge.

Overview

Android Arsenal Maven Central Android Weekly API Build Status

DEPRECATED - ShimmerLayout

Attention: This tool is now deprecated. Please switch to Shimmer for Android or any other shimmer effect solution.

ShimmerLayout can be used to add shimmer effect (like the one used at Facebook or at LinkedIn) to your Android application. Beside memory efficiency even animating a big layout, you can customize the behaviour and look of the animation. Check out the wiki for attributes!

Download and usage

Get the latest artifact via gradle

implementation 'io.supercharge:shimmerlayout:2.1.0'

Create the layout on which you want to apply the effect and add as a child of a ShimmerLayout

<io.supercharge.shimmerlayout.ShimmerLayout
        android:id="@+id/shimmer_text"
        android:layout_width="wrap_content"
        android:layout_height="40dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="50dp"
        android:paddingLeft="30dp"
        android:paddingRight="30dp"
        app:shimmer_animation_duration="1200">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="ShimmerLayout"
            android:textColor="@color/shimmer_background_color"
            android:textSize="26sp"/>
    </io.supercharge.shimmerlayout.ShimmerLayout>

Last, but not least you have to start it from your Java code

ShimmerLayout shimmerText = (ShimmerLayout) findViewById(R.id.shimmer_text);
shimmerText.startShimmerAnimation();

Further reading

License

ShimmerLayout is opensource, contribution and feedback are welcome!

Apache Version 2.0

Copyright 2017 Supercharge

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author

veghtomi

Supercharge

Comments
  • problem when implement into recyclerview

    problem when implement into recyclerview

    i upload sort clip to demonstration this problem https://media.giphy.com/media/xT1Ra4ix78tdhSqnmw/giphy.gif

    i have recyclerview with 20 items, the problem happen when i scroll down and then scroll up (Sorry about my English)

    opened by leyvien 16
  • Illegal argument exception

    Illegal argument exception

    Any pointers/hints please , getting following exception:

    Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:850) at android.graphics.Bitmap.createBitmap(Bitmap.java:829) at android.graphics.Bitmap.createBitmap(Bitmap.java:796) at io.supercharge.shimmerlayout.ShimmerLayout.createBitmap(SourceFile:373) at io.supercharge.shimmerlayout.ShimmerLayout.getSourceMaskBitmap(SourceFile:322) at io.supercharge.shimmerlayout.ShimmerLayout.drawMask(SourceFile:2252) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.support.v4.widget.DrawerLayout.drawChild(SourceFile:1367) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.updateDisplayListIfDirty(View.java:15279) at android.view.View.draw(View.java:16072) at android.view.ViewGroup.drawChild(ViewGroup.java:3622) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3409) at android.view.View.draw(View.java:16305) at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2760) at android.view.View.updateDisplayListIfDirty(View.java:15284) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:295) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:301) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:345) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2687) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2496) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2121) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6238) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:884) at android.view.Choreographer.doCallbacks(Choreographer.java:696) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:870) at android.os.Handler.handleCallback(Handler.java:743) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:5621) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

    opened by baboog 9
  • OOM Crash

    OOM Crash

    Hi, here is some problems:

    Android: 4.1.2
    Manufacturer: samsung
    Model: GT-S7390
    Thread: main-1
    
    java.lang.OutOfMemoryError
    	at android.graphics.Bitmap.nativeCreate(Bitmap.java)
    	at android.graphics.Bitmap.createBitmap(Bitmap.java:669)
    	at android.graphics.Bitmap.createBitmap(Bitmap.java:649)
    	at io.supercharge.shimmerlayout.ShimmerLayout.createBitmap(ShimmerLayout.java:320)
    	at io.supercharge.shimmerlayout.ShimmerLayout.getDestinationBitmap(ShimmerLayout.java:249)
    	at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDrawUsingBitmap(ShimmerLayout.java:184)
    	at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDraw(ShimmerLayout.java:100)
    	at android.view.View.draw(View.java:13825)
    	at android.widget.FrameLayout.draw(FrameLayout.java:467)
    	at android.view.View.getDisplayList(View.java:12773)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.support.v7.widget.RecyclerView.drawChild(RecyclerView.java:4581)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.draw(View.java:13825)
    	at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3987)
    	at android.view.View.getDisplayList(View.java:12773)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1229)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.draw(View.java:13825)
    	at android.widget.FrameLayout.draw(FrameLayout.java:467)
    	at android.view.View.getDisplayList(View.java:12773)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.getDisplayList(View.java:12771)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.View.draw(View.java:13546)
    	at android.view.ViewGroup.drawChild(ViewGroup.java:3226)
    	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3091)
    	at android.view.View.draw(View.java:13825)
    	at android.widget.FrameLayout.draw(FrameLayout.java:467)
    	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2458)
    	at android.view.View.getDisplayList(View.java:12773)
    	at android.view.View.getDisplayList(View.java:12817)
    	at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1144)
    	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2313)
    	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2185)
    	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1993)
    	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1143)
    	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4684)
    	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
    	at android.view.Choreographer.doCallbacks(Choreographer.java:555)
    	at android.view.Choreographer.doFrame(Choreographer.java:525)
    	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
    	at android.os.Handler.handleCallback(Handler.java:615)
    	at android.os.Handler.dispatchMessage(Handler.java:92)
    	at android.os.Looper.loop(Looper.java:177)
    	at android.app.ActivityThread.main(ActivityThread.java:4947)
    	at java.lang.reflect.Method.invokeNative(Method.java)
    	at java.lang.reflect.Method.invoke(Method.java:511)
    	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
    	at dalvik.system.NativeStart.main(NativeStart.java)
    
    opened by robohorse 6
  • Use removeGlobalOnLayoutListener for API 15+

    Use removeGlobalOnLayoutListener for API 15+

    Have you considered using removeGlobalOnLayoutListener here:

    https://github.com/team-supercharge/ShimmerLayout/blob/master/shimmerlayout/src/main/java/io/supercharge/shimmerlayout/ShimmerLayout.java#L98

    This way, you can drop the minimum version of Android required to API 15 (v4.0.3). Although not a major jump, this makes this library available a few more devices.

    opened by mattleibow 6
  • Im using shimmer On a CardView which is attached to a adapter and the app the crarshes?

    Im using shimmer On a CardView which is attached to a adapter and the app the crarshes?

    Here is my layout

    `

        <io.supercharge.shimmerlayout.ShimmerLayout
            android:id="@+id/shimmer_Main_card"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="50dp"
            android:paddingLeft="30dp"
            android:paddingRight="30dp"
            app:shimmer_animation_duration="1200">
    
        <android.support.v7.widget.CardView
            android:id="@+id/hostelCard"
            android:elevation="10dp"
            app:cardCornerRadius="30dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="10dp">
    
            <RelativeLayout
                android:layout_width="330dp"
                android:layout_height="220dp"
                android:layout_gravity="center">
    
                <ImageView
                    android:id="@+id/LocationMainImage"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:layout_alignParentEnd="true"
                    android:layout_marginStart="0dp"
                    android:layout_marginTop="7dp"
                    android:layout_marginEnd="10dp"
                    android:padding="4dp"
                    android:src="@drawable/logo" />
    
                <TextView
                    android:id="@+id/LocationName"
                    android:layout_width="wrap_content"
                    android:layout_height="38dp"
                    android:layout_below="@id/LocationMainImage"
                    android:layout_alignParentStart="true"
                    android:layout_marginStart="3dp"
                    android:layout_marginTop="-217dp"
                    android:background="@color/black"
                    android:text="Hostel 1"
                    android:textAllCaps="true"
                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Title"
                    android:textColor="@color/yellow" />
    
    
            </RelativeLayout>
    
        </android.support.v7.widget.CardView>
    
        </io.supercharge.shimmerlayout.ShimmerLayout>
    
    </LinearLayout>
    

    Thanks in advance`

    opened by chigup 5
  • fixed bug in android 4.1.1 (team-supercharge/ShimmerLayout#66).

    fixed bug in android 4.1.1 (team-supercharge/ShimmerLayout#66).

    in ShimmerLayout is used ComposeShader, which contains bug in android 4.1.1 with layer hardware acceleration: https://stackoverflow.com/questions/12445583/issue-with-composeshader-on-android-4-1-1

    opened by gaulazat 5
  • IllegalArgumentException: width and height must be > 0

    IllegalArgumentException: width and height must be > 0

    I am getting this error in ShimmerLayout class. What could be the issue?

    Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:969) at android.graphics.Bitmap.createBitmap(Bitmap.java:948) at android.graphics.Bitmap.createBitmap(Bitmap.java:915) at io.supercharge.shimmerlayout.ShimmerLayout.createBitmap(ShimmerLayout.java:317) at io.supercharge.shimmerlayout.ShimmerLayout.getSourceMaskBitmap(ShimmerLayout.java:273) at io.supercharge.shimmerlayout.ShimmerLayout.drawMask(ShimmerLayout.java:203) at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDrawUsingBitmap(ShimmerLayout.java:193) at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDraw(ShimmerLayout.java:100)

    opened by kavitamp 5
  • AAPT: error: duplicate value for resource 'attr/layout_gravity' with config.

    AAPT: error: duplicate value for resource 'attr/layout_gravity' with config.

    I updated my android studio from 3.1.3 to 3.4 and changed the targetSdkVersion to 28. PS: classpath 'com.android.tools.build:gradle:3.4.0'. After which I am getting the following compile time error and I am not able to generate the build for my app.

    And this is the error displayed:

    C:\Users\admin.gradle\caches\transforms-2\files-2.1\a31c077a0c9e7184e12caa4ae20cff19\res\values\values.xml:4:5-501: AAPT: error: duplicate value for resource 'attr/layout_gravity' with config ''.

    C:\Users\admin.gradle\caches\transforms-2\files-2.1\a31c077a0c9e7184e12caa4ae20cff19\res\values\values.xml:4:5-501: AAPT: error: resource previously defined here. valuesxml.txt

    opened by RohitK1992 4
  • Use with Recyclerview and Glide, some animation not stop properly

    Use with Recyclerview and Glide, some animation not stop properly

    Hi, in my Recyclerview I'm using ShimmerLayout to wrap a ImageView, layout file like below:

    <?xml version="1.0" encoding="utf-8"?>
    <io.supercharge.shimmerlayout.ShimmerLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/shimmerLayout"
        android:layout_width="240dp"
        android:layout_height="280dp"
        app:shimmer_animation_duration="1200"
        app:shimmer_color="@color/white_secondary">
    
            <ImageView
                android:id="@+id/ivPhoto"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="center" />
    
    </io.supercharge.shimmerlayout.ShimmerLayout>
    

    Inside onBindViewHolder i start animation at begin, and stop animation when Glide load image successful.

    // Start shimmer animation
    holder.shimmerLayout.startShimmerAnimation();
    Log.d("onBindViewHolder", "startAnimation");
    
    // Load image
    GlideApp.with(holder.itemView)
            .load(url)
            .placeholder(R.drawable.photo_placeholder)
            .centerCrop()
            .listener(new RequestListener<Drawable>() {
                @Override
                public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                    holder.shimmerLayout.stopShimmerAnimation();
                    return false;
                }
    
                @Override
                public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                    // Finish loading image, stop shimmer animation
                    Log.d("onBindViewHolder", "onResourceReady");
                    holder.shimmerLayout.stopShimmerAnimation();
                    return false;
                }
            })
            .into(holder.ivPhoto);
    

    The problem is when i scroll the horizontal recyclerview, some items already load image finish, but the animation didn't stop. Screenshot: http://i.imgur.com/o1DFbh8.png ,item at the right side is still in shimmer animation.

    The log shows that onResourceReady is execute after animation start:

    08-08 03:25:53.345 19556-19556/org.mariamumu.supportmebackend D/onBindViewHolder: startAnimation
    08-08 03:25:53.401 19556-19556/org.mariamumu.supportmebackend D/onBindViewHolder: onResourceReady
    

    Not sure if this is an issue in stopShimmerAnimation, any reply will be appreciated, thanks!

    opened by IvanBean 4
  • Issue with invisible RecyclerView item

    Issue with invisible RecyclerView item

    Hi!

    Case: We subscribe to some event and start/stop shimmer animation in onSubscribe/onFinally in bindView() of ViewHolders of our RecyclerView. In ViewHolders which are visible to a user there is no problem but in elements which are off the screen shimmer animation starts but doesn't stop although stopShimmerAnimation() called. If you scroll up and down bindView() will be called again and shimmer animation will be stopped.

    opened by ankudryavtsev 3
  • Shimmering Stop in RecyclerView

    Shimmering Stop in RecyclerView

    Whenever I scroll in Recyclerview the shimmering part is stop just like in this video.

    https://drive.google.com/file/d/1jr32P_av4cP9tHqW-UBkOnrSoWDqO5LI/view

    opened by ArcherEmiya05 3
  • Attempt to invoke interface method 'long[] android.graphics.IShaderExt.getColorLongs()'

    Attempt to invoke interface method 'long[] android.graphics.IShaderExt.getColorLongs()'

    java.lang.NullPointerException: Attempt to invoke interface method 'long[] android.graphics.IShaderExt.getColorLongs()' on a null object reference

    at android.graphics.ShaderExtImpl.getComposeShaderColor(ShaderExtImpl.java:76)
    
    at android.graphics.ShaderExtImpl.getComposeShaderColor(ShaderExtImpl.java:65)
    
    at com.oplus.darkmode.OplusDarkModeThirdInvertManager.getRealPaintState(OplusDarkModeThirdInvertManager.java:629)
    
    at com.oplus.darkmode.OplusDarkModeManager.getRealPaintState(OplusDarkModeManager.java:501)
    
    at android.graphics.BaseCanvasExtImpl.changeArea(BaseCanvasExtImpl.java:148)
    
    at android.graphics.BaseRecordingCanvas.drawRect(BaseRecordingCanvas.java:563)
    
    at io.supercharge.shimmerlayout.ShimmerLayout.b(ShimmerLayout.java:261)
    
    at io.supercharge.shimmerlayout.ShimmerLayout.a(ShimmerLayout.java:250)
    
    at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDraw(ShimmerLayout.java:106)
    
    at android.view.View.draw(View.java:22938)
    
    at android.view.View.updateDisplayListIfDirty(View.java:21751)
    
    at android.view.View.draw(View.java:22637)
    
    at android.view.ViewGroup.drawChild(ViewGroup.java:4652)
    
    at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030)
    
    opened by Tukesboy 1
  • ColorSoftDarkModeManager.java line 645 com.color.darkmode.ColorSoftDarkModeManager.handleShader

    ColorSoftDarkModeManager.java line 645 com.color.darkmode.ColorSoftDarkModeManager.handleShader

    I get the following error on my Crashlytic dashboard.

    I am not sure how to reproduce. Can you guys help me out ? Thanks

    Fatal Exception: java.lang.IllegalArgumentException: Shader parameters must not be null at android.graphics.ComposeShader.(ComposeShader.java:79) at android.graphics.ComposeShader.getDarkModeShader(ComposeShader.java:111) at com.color.darkmode.ColorSoftDarkModeManager.handleShader(ColorSoftDarkModeManager.java:645) at com.color.darkmode.ColorSoftDarkModeManager.changePaintWhenDrawArea(ColorSoftDarkModeManager.java:450) at com.color.darkmode.ColorSoftDarkModeManager.changePaintWhenDrawArea(ColorSoftDarkModeManager.java:472) at com.color.darkmode.ColorDarkModeManager.changePaintWhenDrawArea(ColorDarkModeManager.java:905) at android.graphics.OppoBaseBaseCanvas.changeArea(OppoBaseBaseCanvas.java:117) at android.graphics.BaseRecordingCanvas.drawRect(BaseRecordingCanvas.java:557) at io.supercharge.shimmerlayout.ShimmerLayout.ɩ(:261) at io.supercharge.shimmerlayout.ShimmerLayout.ι(:250) at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDraw(:106) at android.view.View.draw(View.java:21820) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(:2023) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(:2023) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(:2023) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at androidx.core.widget.NestedScrollView.draw(:1998) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(:1277) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at androidx.viewpager.widget.ViewPager.draw(:2426) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(:1277) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at androidx.viewpager.widget.ViewPager.draw(:2426) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(:1277) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.updateDisplayListIfDirty(View.java:20633) at android.view.View.draw(View.java:21525) at android.view.ViewGroup.drawChild(ViewGroup.java:4542) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4279) at android.view.View.draw(View.java:21820) at com.android.internal.policy.DecorView.draw(DecorView.java:869) at android.view.View.updateDisplayListIfDirty(View.java:20642) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:575) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:581) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:654) at android.view.ViewRootImpl.draw(ViewRootImpl.java:4125) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3913) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3219) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2050) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8455) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1057) at android.view.Choreographer.doCallbacks(Choreographer.java:881) at android.view.Choreographer.doFrame(Choreographer.java:808) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7830) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1040)

    opened by rezastallone 2
  • Crashing on Moto Z2 Play

    Crashing on Moto Z2 Play

    Crashing don't use its deprecated.

    java.lang.RuntimeException: Canvas: trying to draw too large(245486224bytes) bitmap.
            at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
            at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
            at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
            at android.view.View.getDrawableRenderNode(View.java:19393)
            at android.view.View.drawBackground(View.java:19329)
            at android.view.View.draw(View.java:19126)
            at android.view.View.updateDisplayListIfDirty(View.java:18085)
            at android.view.View.draw(View.java:18863)
            at android.view.ViewGroup.drawChild(ViewGroup.java:4218)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4004)
            at android.view.View.draw(View.java:19138)
            at android.view.View.updateDisplayListIfDirty(View.java:18085)
            at android.view.View.draw(View.java:18863)
            at android.view.ViewGroup.drawChild(ViewGroup.java:4218)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4004)
            at android.view.View.draw(View.java:19138)
            at android.view.View.updateDisplayListIfDirty(View.java:18085)
            at android.view.View.draw(View.java:18863)
            at android.view.ViewGroup.drawChild(ViewGroup.java:4218)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4004)
            at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDrawShimmer(ShimmerLayout.java:230)
            at io.supercharge.shimmerlayout.ShimmerLayout.dispatchDraw(ShimmerLayout.java:106)
    
    opened by DastanIqbal 0
  • incorrect behaviour + memory leak fix

    incorrect behaviour + memory leak fix

    I found that if we call startAnimation more then once when the view has 0 size we will add 2 PreDrawListeners. And everything was ok except the case when I cancel shimmer animation before the view size change. In this case - animation will start anyway because stopShimmerAnimation will remove only latest PreDrawListener. In this case animation will start anyway. The second thing - if I navigate back too quick I've noticed that I have a warning about memory leak from LeakCanary. And during the debug found that there can be a case when this PreDrawListener will fire without cancelling and animation will run even if the view is detached.

    This PR should fix https://github.com/team-supercharge/ShimmerLayout/issues/75

    opened by mig35 7
Owner
Supercharge
We create stunning experiences on mobile and on the web
Supercharge
☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer or Memory leak)

Material Intro Sophisticated and cool intro with Material Motion Animations. Who's using Material Intro? ?? Check out who's using Material Intro Inclu

Ranbir Singh 34 Sep 8, 2022
A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android

android-flip Aphid FlipView is a UI component to accomplish the flipping animation like Flipboard does. A pre-built demo APK file for Android OS 2.2+

Bo 2.8k Dec 21, 2022
Android ImageViews animated by Ken Burns Effect

KenBurnsView Android library that provides an extension to ImageView that creates an immersive experience by animating its drawable using the Ken Burn

Flávio Faria 2.7k Jan 2, 2023
Android L Ripple effect wrapper for Views

Material Ripple Layout Ripple effect wrapper for Android Views Including in your project compile 'com.balysv:material-ripple:1.0.2' Check for latest v

Balys Valentukevicius 2.3k Dec 29, 2022
Implementation of Ripple effect from Material Design for Android API 9+

RippleEffect ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow a ma

Robin Chutaux 4.9k Dec 30, 2022
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

Manabu S. 755 Dec 29, 2022
[] Easily have blurred and transparent background effect on your Android views.

##[DEPRECATED] BlurBehind Easily have blurred and transparent background effect on your Android views. Before API level 14 there was a Window flag cal

Gokberk Ergun 516 Nov 25, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
:sparkles: An easy way to implement an elastic touch effect for Android.

ElasticViews ✨ An easy way to implement an elastic touch effect for Android. Including in your project Gradle Add below codes to your root build.gradl

Jaewoong Eum 763 Dec 29, 2022
A pager for Android with parallax effect

ParallaxPagerTransformer A pager transformer for Android with parallax effect Installation in your build.gradle file dependencies { // ... com

Javier Gonzalez 654 Dec 29, 2022
Library provides an easy way to a add shimmer effect in Android Compose project.

Add a shimmer effect to the layout in Android Compose

Valery 66 Dec 14, 2022
"Gooey-Effect" for android-compose

Gooey effect for android-compose "Gooey" is a library made to use "gooey-effect" that exists as a CSS trick in android-compose. Download repositories

SeokHo-Im 5 Oct 12, 2022
ViewAnimator view with a lollipop style reveal effect

ViewRevealAnimator Widget ViewAnimator view with a lollipop style reveal effect. Regular animation can be set (just like the default ViewAnimator) for

Alessandro Crugnola 339 Jun 3, 2022
Library project to display DialogFragment with a blur effect.

BlurDialogFragment This project allows to display DialogFragment with a burring effect behind. The blurring part is achieved through FastBlur algorith

tvbarthel 2.1k Dec 29, 2022
explosive dust effect for views

ExplosionField explosive dust effect for views Getting started In your build.gradle: dependencies { compile 'tyrantgit:explosionfield:1.0.1' } Ex

null 3.6k Dec 29, 2022
Glass-break effect for views

BrokenView Glass-break effect for views. Demo Download APK Usage Android Studio dependencies { compile 'com.zys:brokenview:1.0.3' } Eclipse Just pu

null 859 Dec 30, 2022
Wave effect of activity animation

WaveCompat Wave effect of activity animation How to use 1. Bind wave touch helper to a view which will start an activity when it clicked: WaveTouchHel

WangJie 348 Nov 29, 2022
ShimmerTextView is a simple library to integrate shimmer effect in your TextView.

ShimmerTextView ShimmerTextView is a simple library to integrate shimmer effect in your TextView. Key features Set a base color in ShimmerTextView. Se

MindInventory 22 Sep 7, 2022
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

Nightonke 2.7k Dec 30, 2022