geftimov / android-pathview Goto Github PK
View Code? Open in Web Editor NEWAndroid view with both path from constructed path or from svg.
License: Apache License 2.0
Android view with both path from constructed path or from svg.
License: Apache License 2.0
The sample project crashes with an internal platform error (no stacktrace). Crashes on devices from API 14 till API 19, different device models, emulated and physical devices as well. Works on API 19 and above.
I have an error which crash app:
Attempt to invoke virtual method 'android.graphics.RectF com.caverock.androidsvg.SVG.getDocumentViewBox()' on a null object reference
Bug occurs on tablet with tegra 2 and phones with Mediatek.
Full error log:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.RectF com.caverock.androidsvg.SVG.getDocumentViewBox()' on a null object reference at com.eftimoff.androipathview.SvgUtils.rescaleCanvas(SvgUtils.java:129) at com.eftimoff.androipathview.SvgUtils.drawSvgAfter(SvgUtils.java:76) at com.eftimoff.androipathview.PathView.fillAfter(PathView.java:216) at com.eftimoff.androipathview.PathView.onDraw(PathView.java:204) at android.view.View.draw(View.java:15231) at android.view.View.updateDisplayListIfDirty(View.java:14167) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.draw(View.java:15234) at android.view.View.updateDisplayListIfDirty(View.java:14167) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.updateDisplayListIfDirty(View.java:14162) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.updateDisplayListIfDirty(View.java:14162) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.updateDisplayListIfDirty(View.java:14162) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.updateDisplayListIfDirty(View.java:14162) at android.view.View.getDisplayList(View.java:14189) at android.view.View.draw(View.java:14959) at android.view.ViewGroup.drawChild(ViewGroup.java:3405) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198) at android.view.View.draw(View.java:15234) at android.widget.FrameLayout.draw(FrameLayout.java:598) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2650) at android.view.View.updateDisplayListIfDirty(View.java:14167) at android.view.View.getDisplayList(View.java:14189) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2530) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5296) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Hi, i'm using your library and it's great , but i was wondering if there was a possibility to animate color filling
Hi,
Once you have the project configured and running, It crashes when the phone is in Battery saving mode [android 5.1 ], Tested it on device Moto E 1st Gen android.
Hi,
I am trying to draw a path, smth like an arch with rounded corners, however "stroke-linecap" parameter seems to be skipped and so the result image is without rounded corners.
svg example:
layout:
<com.eftimoff.androipathview.PathView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/archLeftPathView"
android:layout_width="180dp"
android:layout_height="180dp"
app:pathColor="@android:color/white"
app:svg="@raw/arc_left"
app:pathWidth="60"/>
may be I am missing smth?
You can verify the svg using smth like http://www.rapidtables.com/web/tools/svg-viewer-editor.htm
i want update svg 's path after i load a svg
I mean animate from drawn state to erased state. Actually, I want to do cyclic animation for progress loader, which will be animate painting then animate erasing then again painting and then erasing and so on... Could you give me a hint how to do it ?
use the svg file that I generated having a problem :
com.caverock.androidsvg.SVGParseException: SVG parse error: At line 2, column 51: syntax error
at com.caverock.androidsvg.SVGParser.parse(SVGParser.java:611)
at com.caverock.androidsvg.SVG.getFromResource(SVG.java:187)
at com.caverock.androidsvg.SVG.getFromResource(SVG.java:172)
at com.eftimoff.androipathview.SvgUtils.load(SvgUtils.java:60)
at com.eftimoff.androipathview.PathView$1.run(PathView.java:242)
at java.lang.Thread.run(Thread.java:818)
Caused by: org.apache.harmony.xml.ExpatParser$ParseException: At line 2, column 51: syntax error
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:515)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
at com.caverock.androidsvg.SVGParser.parse(SVGParser.java:599)
at com.caverock.androidsvg.SVG.getFromResource(SVG.java:187)
at com.caverock.androidsvg.SVG.getFromResource(SVG.java:172)
at com.eftimoff.androipathview.SvgUtils.load(SvgUtils.java:60)
at com.eftimoff.androipathview.PathView$1.run(PathView.java:242)
at java.lang.Thread.run(Thread.java:818)
Warning:com.caverock.androidsvg.SVGImageView: can't find referenced class com.caverock.androidsvg.R$styleable
When creating a release build. I mean progaurd is removing this class
have any idea to fix it ?
when I invoke this method setSvgResource() to change the resourse of SVG, the SVG animator is still the playing as the old one
can not add PathView in a ScrollView when ScollView has a LinearLayout and the Linearlayout holds more than one sub view
hi,
when i add Circle to the path using this code :
path.addCircle(width/2,width/2,width-padding, Path.Direction.CW);
pathview make Circle is not shown
Hi,
property: "android:allowBackup" shouldn't be used in library because it cause an error with building app on prodction
I am using a Colored Svg as source. It traces the path of the svg. But I need to color the svg after tracing the path.
Is there a way to do it?
dependencies{
compile 'com.eftimoff:android-pathview:1.0.6@aar'
}
<com.eftimoff.androipathview.PathView
android:id="@+id/pathView"
android:layout_width="150dp"
android:layout_height="150dp"
app:pathColor="@android:color/white"
app:pathWidth="10"
app:svg="@raw/settings"/>
in activity xml , running but no find
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);
It's very good .
This happens when I try to add a SVG file to the raw folder. Is there something I should check with the SVG doc before using it?
Hi
First I should say thanks for your awesome library .
If there was a property in PathView tag something like app:fillAfter="true" or app:fill="true" would be very useful , because some times we need to use it as a special SVG image view for just showing whole image without animation , I know there is some libraries for showing SVG images out there , but it would be good to have just one library that can animate SVG images and also showing them statically .
For now I'm doing it by writing PathView.setFillAfter(true); in code and setting animation duration to 1 for showing it immediately , but you know it's a little dirty :P
Also if you like I can help you in making these changes in code to merge with master branch.
I want a loading animation
I have about a second delay in my path view. Is there anyway to say
Hello! Is it possible to animate the paths sequentially, insteady of in parallel? Congratulations for your great work, thanks!
Like the one shown above ,When I use the code below, it happens.
pathView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// pathView.getPathAnimator().
pathView.getSequentialPathAnimator().
delay(100).
duration(5000).
interpolator(new AccelerateDecelerateInterpolator()).
start();
。。。。。
Error:No such property: sonatypeRepo for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
Hi, When I use the pathview, memory has been growing, how can I reduce the memory?
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.