B4A Library LoadingIndicatorView

this is a wrapper for this github project.

Demo2.gif


LoadingIndicators
Author: DonManfred <msy1912@gmail.com>
Version: 1.01
  • Indicator
    Properties:
    • BallBeat As Int [read only]
    • BallClipRotate As Int [read only]
    • BallClipRotateMultiple As Int [read only]
    • BallClipRotatePulse As Int [read only]
    • BallGridBeat As Int [read only]
    • BallGridPulse As Int [read only]
    • BallPulse As Int [read only]
    • BallPulseRise As Int [read only]
    • BallPulseSync As Int [read only]
    • BallRotate As Int [read only]
    • BallScale As Int [read only]
    • BallScaleMultiple As Int [read only]
    • BallScaleRipple As Int [read only]
    • BallScaleRippleMultiple As Int [read only]
    • BallSpinFadeLoader As Int [read only]
    • BallTrianglePath As Int [read only]
    • BallZigZag As Int [read only]
    • BallZigZagDeflect As Int [read only]
    • CubeTransition As Int [read only]
    • LineScale As Int [read only]
    • LineScaleParty As Int [read only]
    • LineScalePulseOut As Int [read only]
    • LineScalePulseOutRapid As Int [read only]
    • LineSpinFadeLoader As Int [read only]
    • Pacman As Int [read only]
    • SemiCircleSpin As Int [read only]
    • SquareSpin As Int [read only]
    • TriangleSkewSpin As Int [read only]
  • LoadingIndicatorView
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (indicatorID As Int)
    • 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)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • IndicatorColor As Int
    • IndicatorId As Int [write only]
    • Left As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

  • libLoadingIndicatorViewV1.0.0.zip
    157.8 KB · Views: 762
  • LoadingIndicatorsEx.zip
    9.8 KB · Views: 887
  • libLoadingIndicatorViewV1.0.1.zip
    158.3 KB · Views: 673
Last edited:

migrec

Member
Licensed User
Longtime User
Pretty weird, It wont compile even though I havent written any code yet

B4X:
Parsing code.                           0.02
Compiling code.                         0.06
Compiling layouts code.                 0.00
Generating R file.                      0.66
Compiling generated Java code.          2.50
Convert byte code - optimized dex.      Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/nineoldandroids/animation/Animator$AnimatorListener;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
    at com.android.dx.command.dexer.Main.processClass(Main.java:732)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
    at com.android.dx.command.dexer.Main.access$300(Main.java:83)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:632)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
1 error; aborting
    Optimized dexer failed. Switching to Standard dexer.
 

migrec

Member
Licensed User
Longtime User
I dont understand really, I have nineoldandroid lib aswell, is this a problem for your wrapper?
 

migrec

Member
Licensed User
Longtime User
MSMaterialMenu was the troublemaker, i just unchecked it and now it runs just fine, thanks for helping me out :)
 

bluejay

Active Member
Licensed User
Longtime User
It would be better to have descriptive names for the arguments rather than arg0, arg1, arg2....
 

DonManfred

Expert
Licensed User
Longtime User
It would be better to have descriptive names for the arguments rather than arg0, arg1, arg2....
Write a wrapper, use
B4X:
 extends ViewWrapper<Object>
and you will get a lot of methods which belongs to the ViewWrapper.
I COULD create a pseudo method with the same same to override the ViewWrapper methods. A LOT of work for nothing...

Note that i did not gave these names to the methods from the ViewWrapper
 

Kwame Twum

Active Member
Licensed User
Longtime User
Hello everyone, looks like the IndicatorId is not modifiable when the LoadingIndicatorView is added at run time.
When added with the designer, it is modifiable anywhere.
Is that by design?
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
like the IndicatorId is not modifiable
B4X:
Sub Activity_Resume
    li1.IndicatorId = Rnd(0,27)
    li1.IndicatorColor = Colors.Red
End Sub
does the upper left idicator does not change color for you if you do a orientationchange?

Anyway; i´ve uploaded V1.0.1 with support for the new CustomProperties in Designer. I´ve tested above code with my device. If i do a orientation-change then the upper left idicator is changing in type (id) and color.
 
Last edited:

Kwame Twum

Active Member
Licensed User
Longtime User
You added the indicators via the designer, I'm talking about when you add them at run time like this:
B4X:
Sub btn_Click
   Dim ld as LoadingIndicatorView
   ld.initialize(3)
   ld.IndicatorId = 3
   'Add to Activity
   Activity.addView(ld,.....) 'I can place this wherever I want
End Sub

When I keep changing the IndicatorId everytime I test this, it still shows the same animation... :(
 

DonManfred

Expert
Licensed User
Longtime User
I'm talking about when you add them at run time like this
It is working for me. I added this to my example-code

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    licode.Initialize(2)
    Activity.AddView(licode,100dip,100%y-50dip,50dip,50dip)
End Sub

Sub Activity_Resume
    licode.IndicatorId = Rnd(0,27)
    licode.IndicatorColor = Colors.ARGB(Rnd(100, 150),Rnd(20, 800),Rnd(80, 160),Rnd(161, 255))
End Sub
 

Leni Berry

Active Member
Licensed User
Longtime User
i cant run this sample project...

LogCat connected to: ae79ec6b
--------- beginning of system
--------- beginning of main
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 349)
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:208)
at b4a.loadingindicators.main._activity_create(main.java:349)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at b4a.loadingindicators.main.afterFirstLayout(main.java:102)
at b4a.loadingindicators.main.access$000(main.java:17)
at b4a.loadingindicators.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6145)
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:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at de.donmanfred.AVLoadingIndicatorViewWrapper.DesignerCreateView(AVLoadingIndicatorViewWrapper.java:54)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:60)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
... 16 more
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
 
Top