jamesnguyenhub / mkloader Goto Github PK
View Code? Open in Web Editor NEWBeautiful and smooth custom loading views
License: Apache License 2.0
Beautiful and smooth custom loading views
License: Apache License 2.0
| com.tuyenmonkey.mkloader.type.ClassicSpinner.draw + 57 (ClassicSpinner.java:57)
| com.tuyenmonkey.mkloader.MKLoader.onDraw + 61 (MKLoader.java:61)
| android.view.View.draw + 20463 (View.java:20463)
| android.view.ViewGroup.dispatchDraw + 4170 (ViewGroup.java:4170)
| com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.dispatchDraw + 769 (CustomViewAbove.java:769)
| android.view.View.draw + 20466 (View.java:20466)
| com.android.internal.os.ZygoteInit.main + 958 (ZygoteInit.java:958)
Hello, i've found a little mistake which makes memory leaks. In each implementation of LoaderView you use invalidateListener in infinity ValueAnimator and it holds a context (yep, activity).
Easy solution:
Add to MKLoader view:
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); loaderView.setInvalidateListener(null); }
and in each ValueAnimator check for invalidateListener == null
and stop animations
Hello, I added this library in the dependencies, after building the gradle, it gives the following errors. Can you give me a solution?
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
My compileSdkVersion and buildToolsVersion both are set to 23.
i have testes in android 5 device but loader not move to display progress
The below implementation of onMeasure is showing wrong height and width in <= 5.0 devices.
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int measuredWidth = resolveSize(loaderView.getDesiredWidth(), widthMeasureSpec);
final int measuredHeight = resolveSize(loaderView.getDesiredHeight(), heightMeasureSpec);
setMeasuredDimension(measuredWidth, measuredHeight);
}
When the MKLoader from GONE to VISIBLE, Picture torn.
code:
public class MainActivity extends AppCompatActivity {
View view = null;
@OverRide protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loader1);
view = findViewById(R.id.twinFishSpinner);
handler.sendEmptyMessageDelayed(0, 5000);
}
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if(view.getVisibility() == View.GONE) {
view.setVisibility(View.VISIBLE);
}else {
view.setVisibility(View.GONE);
}
sendEmptyMessageDelayed(0, 5000);
}
};
}
can not change mk_color programmatically because the LoaderView has not public or have not a setter
After having watched memory allocation, I noticed that lots of Float
, Integer
object created during onAnimationUpdate
method.
?
用代码怎么调用 能封装成工具类吗 全局的
Please remove allowBackup from library's manifest file.It conflicts with the main app's manifest.
The loader was running smoothly, unless I update the device with Android Pie update.
Attaching log response for your reference.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.PointF com.tuyenmonkey.mkloader.model.Line.getPoint1()' on a null object reference
at com.tuyenmonkey.mkloader.type.Pulse.draw(Pulse.java:67)
at com.tuyenmonkey.mkloader.MKLoader.onDraw(MKLoader.java:61)
at android.view.View.draw(View.java:20211)
at android.view.View.updateDisplayListIfDirty(View.java:19086)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4136)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20214)
at android.support.v4.view.ViewPager.draw(ViewPager.java:2420)
at android.view.View.updateDisplayListIfDirty(View.java:19086)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1254)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20214)
at android.view.View.updateDisplayListIfDirty(View.java:19086)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19077)
at android.view.View.draw(View.java:19939)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20214)
at com.android.internal.policy.DecorView.draw(DecorView.java:780)
at android.view.View.updateDisplayListIfDirty(View.java:19086)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3327)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3124)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2493)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1468)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7208)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1004)
at android.view.Choreographer.doCallbacks(Choreographer.java:816)
at android.view.Choreographer.doFrame(Choreographer.java:751)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:990)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Hi,
I noticed that if you put the MKLoader inside a recycler view item, when the view holder is recycled the animation is stopped.
Can you look at the issue?
Thanks
You must stop animation when view is be detached and the animation is infinity。
put the MKLoader in a dialog, then there is a memory leak. There's a callback reference to view and not release it.
I want to change mk_type through activity but I didn't find any method or docs related to that.
Please tell me how to change it.
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.