Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

divide by zero #40

Open
moeindev opened this issue Feb 2, 2018 · 1 comment
Open

divide by zero #40

moeindev opened this issue Feb 2, 2018 · 1 comment

Comments

@moeindev
Copy link

moeindev commented Feb 2, 2018

hi, thank for this great library but I have a problem I get this error when I'm trying to run it my splash activity

here is the error :
02-02 14:24:17.101 15421-15421/? E/AndroidRuntime: FATAL EXCEPTION: main Process: telegram.abdi.messangerbot, PID: 15421 java.lang.RuntimeException: Unable to start activity ComponentInfo{telegram.abdi.messangerbot/telegram.abdi.messangerbot.Activities.SplashActivity}: java.lang.ArithmeticException: divide by zero at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) Caused by: java.lang.ArithmeticException: divide by zero at com.eftimoff.androipathview.PathView$AnimatorSetBuilder.duration(PathView.java:620) at telegram.abdi.messangerbot.Activities.SplashActivity.onCreate(SplashActivity.java:35) at android.app.Activity.performCreate(Activity.java:6723) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)

and here is my code :
splash_view.setSvgResource(R.drawable.ic_splash_bot); splash_view.getSequentialPathAnimator() .delay(500) .duration(500) .listenerStart(new StartListener()) .listenerEnd(new EndListener()) .interpolator(new AccelerateDecelerateInterpolator()) .start(); splash_view.useNaturalColors(); splash_view.setFillAfter(true);

@MaxMyalkin
Copy link

MaxMyalkin commented Apr 2, 2018

It's because paths are loaded asynchronously in PathView.
image

and there is no paths when you try to set duration.

You can try to run animation after delay:
Handler(Looper.getMainLooper()).postDelayed({ pathView.sequentialPathAnimator .duration(500) .listenerEnd({}) .interpolator(AccelerateDecelerateInterpolator()) .start() }, 300)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants