elye / loaderviewlibrary Goto Github PK
View Code? Open in Web Editor NEWLibrary that enables TextView of ImageView to show loading animation while waiting for the text and image get loaded
License: Apache License 2.0
Library that enables TextView of ImageView to show loading animation while waiting for the text and image get loaded
License: Apache License 2.0
android.view.InflateException: Binary XML file line #39: Error inflating class
i don't have much data to load so before shimmer can be displayed data loads if possible add a time delay before data set to imageView and TextView
Thanks for your great library,
But i want to know how can i enable loading view after setText()
method called,
When use LoaderTextView
inside RecyclerView
adapter and when refreshing the adapter and waiting for server response it will be great to enabled loading view again without re-inflating visible items,
Source code:
valueAnimator.cancel();
setValueAnimator(progress, 0, 0);
valueAnimator.start();
After execution, the animation has been running and has not stopped, causing memory to continue to grow,Debug The onAnimationUpdate monitor is being implemented.
09-06 10:13:35.894 28244-28244/com.elyeproj.sampleloaderview E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.elyeproj.sampleloaderview, PID: 28244
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.elyeproj.sampleloaderview/com.elyeproj.sampleloaderview.MainActivity}: android.view.InflateException: Binary XML file line #39: Error inflating class
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2187)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5034)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.aurora_org_main(ZygoteInit.java:607)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.elyeproj.sampleloaderview.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5247)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at com.lbe.security.service.core.client.b.v.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5034)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.aurora_org_main(ZygoteInit.java:607)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.elyeproj.sampleloaderview.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5247)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at com.lbe.security.service.core.client.b.v.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5034)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.aurora_org_main(ZygoteInit.java:607)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.elyeproj.loaderviewlibrary.LoaderTextView.setRectColor(LoaderTextView.java:86)
at com.elyeproj.loaderviewlibrary.LoaderController.init(LoaderController.java:48)
at com.elyeproj.loaderviewlibrary.LoaderController.(LoaderController.java:43)
at com.elyeproj.loaderviewlibrary.LoaderTextView.init(LoaderTextView.java:56)
at com.elyeproj.loaderviewlibrary.LoaderTextView.(LoaderTextView.java:41)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.elyeproj.sampleloaderview.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5247)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at com.lbe.security.service.core.client.b.v.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5034)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.aurora_org_main(ZygoteInit.java:607)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(Native Method)
How does it work inside an adapter class??
Use case: I already have a dataset in my listview/recyclerview and I make a swipetorefresh list..
how do I notify the viewholder to start the loading animation while awaiting data from the network ?
Hey! It would be great to have a possibility to set custom shimmer color via xml attribute ;)
How remove the animation fadeout when text was loaded?
I like the library. I would like to suggest a new functionality. My UI components are built dynamically so I know how many they are only on setText(). The problem is that the loader is never shown.
I think would be interesting decoupling the revealContent() action from the setText() so, even after the text is already in place after calling setText(), the text is not really shown until you run a revealContent() action.
Does this make sense?
Issue demo is available here: https://github.com/ashutoshgngwr/loaderviewlibrary/tree/issue-demo/text-alignment
The demo produces the following output where the text is aligned to the centre, but the weighted shimmer is aligned to the start.
Loader not showing if I set android:textAlignment center
I am trying to use LoaderViewLibrary in conjunction with custom TextViews and ImageViews, but encontered some issue - LoaderView interface accessibility (LoaderViewLibrary included via Gradle)
Do you have some experience with supporting custom views without need of "re-implementing" them?
Have you considered using LoaderView as layout encapsulating inner views? Similar to e.g.: https://github.com/traex/RippleEffect
Hi! Very nice library. Is it possible to use it on a editTextView?
Thanks
First your library is cool and simply do what it promises.
As mentioned in the documentation, it is interesting that your implementations extends AppCompatImageView and AppCompatTextView.
Sorry my poor English :(.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.