B4A Library SnakeView

This is a wrapper for this github project.
Quote from Githubproject
Snake library is a simple and animation line chart for Android.

demo.gif


SnakeView
Version:
2
  • SnakeView
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • addValue (value As Float)
    • clear
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • MaxValue As Float [write only]
    • MaximumNumberOfValues As Int [write only]
    • MinValue As Float [write only]
    • StrokeColor As Int
    • StrokeWidth As Int
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int

If you want to donate for my work building the wrapper you can do it here:
 

Attachments

  • libSnakeViewV1.0.0.zip
    8.4 KB · Views: 487
  • SnakeViewEx.zip
    7.7 KB · Views: 360
  • SnakeViewV2.0.zip
    8.3 KB · Views: 364
Last edited:

Scantech

Well-Known Member
Licensed User
Longtime User
Can't install. Error with OS 2.3 Emulator

B4X:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 332)
java.lang.NoClassDefFoundError: android.animation.ObjectAnimator
   at com.github.SnakeView.playAnimation(SnakeView.java:305)
   at com.github.SnakeView.addValue(SnakeView.java:104)
   at de.donmanfred.SnakeViewWrapper.addValue(SnakeViewWrapper.java:56)
   at b4a.snakeview.main._activity_create(main.java:332)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:507)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
   at b4a.snakeview.main.afterFirstLayout(main.java:102)
   at b4a.snakeview.main.access$000(main.java:17)
   at b4a.snakeview.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:3683)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:507)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
   at dalvik.system.NativeStart.main(Native Method)
main_activity_create (java line: 332)
java.lang.NoClassDefFoundError: android.animation.ObjectAnimator
   at com.github.SnakeView.playAnimation(SnakeView.java:305)
   at com.github.SnakeView.addValue(SnakeView.java:104)
   at de.donmanfred.SnakeViewWrapper.addValue(SnakeViewWrapper.java:56)
   at b4a.snakeview.main._activity_create(main.java:332)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:507)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
   at b4a.snakeview.main.afterFirstLayout(main.java:102)
   at b4a.snakeview.main.access$000(main.java:17)
   at b4a.snakeview.main$WaitForLayout.run(main.java:80)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:3683)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:507)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
   at dalvik.system.NativeStart.main(Native Method)
 

JTmartins

Active Member
Licensed User
Longtime User
Hi. Very interesting.

What does the args in the several methods stands for ?

example : SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

what does this args values mean ?

I looked in the git hub, but could find any clue.

Many thanks Don.
 

Tronak

Member
Licensed User
Longtime User
Hi Don. Great work you have done with all your modules. I just found that when putting together this library, and MaterialIcons v1.5, I get this error when compiling:

B4X:
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/github/R;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/github/R$styleable;
2 errors; aborting

There is something to configure, or just don't use those two things together?
 

DonManfred

Expert
Licensed User
Longtime User
I don't know whether these classes are required or not.
@Johan Schoeman told me how to do it to remove the needed Resources.
Based on this i rewrote the lib today. No need for #additionalres anymore with this lib :)
 

Johan Schoeman

Expert
Licensed User
Longtime User
@Johan Schoeman told me how to do it to remove the needed Resources.
Based on this i rewrote the lib today. No need for #additionalres anymore with this lib :)
Manfred, you did not learn this from me. I learnt it from you. Maybe you just missed it when you were showing me the ropes of how to wrap a view....:)
 

DonManfred

Expert
Licensed User
Longtime User
Maybe you just missed it when you were showing me the ropes of how to wrap a view....:)
Maybe. But, honestly spoken, i did not realized it this way at the time i was teaching you.

I think you told this in the "special person - groupchat"...

This has opened my eyes on this. Or maybe. this was the point with the "CLICK" :D
 

Willy Bayot

New Member
Licensed User
It seems that the StrokeColor and StrokeWidthinPx methods do not give correct displayed results.
The stroke color remains Green and its width stays as 2 pixels wide.
This is a slightly modified version of the original example program showing that.
I looked at the original JAVA class in the Github site but I do not see any mistake there.
 

Attachments

  • SnakeView.zip
    402.6 KB · Views: 271
Top