B4J Library [B4X] [XUI] [B4xLib] SD LoadingIndicator

This library is an update of this source based on @Erel's code (here)
New indicators in the shape of Heart, Infinity, Bubble have been added and some bugs have been fixed.

NOTE: You can use this library for personal and commercial use. Include it in your projects. Attention, even if it is a B4XLib library, it is not allowed to decompress it, modify it, change its name or redistribute it without the permission. If you want to study the code, a part of it can be found in the links above. Those are public and you can use them.

SD_LoadingIndicator

Author:
Star-Dust
Version: 0.04
  • SD_LoadingIndicator
    • Functions:
      • BringToFront
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • Hide
      • Initialize (Callback As Object, EventName As String)
      • RemoveViewFromParent
      • RequestFocus
      • SendToBack
      • Show
      • Snapshot As B4XView
    • Properties:
      • Height As Int
      • Left As Int
      • Top As Int
      • Visible As Boolean
      • Width As Int

ezgif.com-crop.gif
 

Attachments

  • B4j Sample.zip
    2.4 KB · Views: 563
  • B4a Sample.zip
    8.7 KB · Views: 585
  • b4i Sample.zip
    2.6 KB · Views: 485
  • B4XPages_LoadingIndicators.zip
    16.8 KB · Views: 623
  • SD_LoadingIndicator.B4xLib
    3.7 KB · Views: 262
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Orrenda! Horrible

View attachment 105898

I was trying to imitate one I saw. I'll fix it. It does not use your library ? (nor the canvases, at the moment, just 3 Labels, but I will have to do it, so it doesn't work).

I would like to show you what I saw but underneath there is a well-known brand :confused:
Above is a link of my code that you can use from the older version of the library.
This new one has some indicators with a code that I have studied a lot and would like to keep for myself. All the others can be found in the codes I write about in the first post.

Your indicator is interesting, but I think it should tighten in the center and not in the lower right. It does not maintain the proportions of the squares and the frame or border as you reduce in size must also be reduced proportionally
 

LucaMs

Expert
Licensed User
Longtime User
Your indicator is interesting, but I think it should tighten in the center and not in the lower right. It does not maintain the proportions of the squares and the frame or border as you reduce in size must also be reduced proportionally
Per questo ti ho detto che è orribile, hehehe.
This is why I wrote it is horrible!

The intention was to get a different animation from that; that was the first attempt, without thinking 2 seconds.

Anyway now I'm discovering something... probably a bug or... I'm completely stupid! I will let you know.
 

TILogistic

Expert
Licensed User
Longtime User
Already discussed with Erel, and not allowed. Otherwise we would have published the bas files.

B4xlib is published for these reasons:
1. Best for the compiler. Changing compiler version to older libraries versions may have problems. So there are no problems
2. You use only one file for all platforms and not one for single platform
3. In the case of B4i, if you use the Builder, you need to ask for permission from erel to build a library. With B4xLib it is not necessary

The latter reason is the main reason why I use the B4xLib.

P.S. It is clear that there is a risk, but going to publish changes as Oparra did seems excessive to me.
It's like stealing a neighbor's bike and walking in front of the window with the stolen bike .... At least hide ... Then if the neighbor calls the police, don't complain
I understand and respect your comments, regarding your B4xLib (MIT license or another?), I know there is time and work in the development of adding new spinners to the published @Erel, and good job @Star-Dust.

I wonder:
Can the B4xLibs published by @Erel be decompressed, to add, modify and adapt them to particular needs?

Tips
- It will work properly in debug mode but will not be smooth. Should look good in release mode.
- You can change the duration of a single cycle. The default is 1000ms. For some of the types such as Arc 1 and Arc 2 it makes sense to change it to about 2000.
- See the code. Shouldn't be difficult to add more types of animations.
- In B4A you should add this code in Activity_Resume:

Regards,
 

Star-Dust

Expert
Licensed User
Longtime User
I understand and respect your comments, regarding your B4xLib (MIT license or another?), I know there is time and work in the development of adding new spinners to the published @Erel, and good job @Star-Dust.

I wonder:
Can the B4xLibs published by @Erel be decompressed, to add, modify and adapt them to particular needs?



Regards,
Thanks for understanding.
For Erel's Libraries, you should ask him.

I asked for the source of a compiled library and he gave it to me. So he will probably say yes. But the important thing is to respect the developer and ask.

Many of my sources are open and free, others I have chosen to keep closed. However you can access the sources of the previous version that I made them public and they will surely be useful to create your own custom
 

LucaMs

Expert
Licensed User
Longtime User
Hello.

@Star-Dust

How can I place the object ?
Left / Top does not exist. (except in the designer)

regards Frank
It would be enough to set (in the library!) mBase as Public instead of Private.
At that point you could write:
B4X:
SD_LoadingIndicator1.mBase.Left = 100dip

I just did and I am attaching the library with the small change; I suppose and hope @Star-Dust has no complaints and puts it in his first post :)
 

Attachments

  • SD_LoadingIndicator.B4xLib
    3.4 KB · Views: 260

Star-Dust

Expert
Licensed User
Longtime User
Update 0.03
  • Added Left, Top, Height, Width and Visible properties
 

FrankDev

Active Member
Licensed User
Longtime User
hi Star-Dust /LucaMS

thank you for the customization!

my processes unfortunately require so much processor power that the loading bar no longer moves.

:((((
 

Star-Dust

Expert
Licensed User
Longtime User
I just did and I am attaching the library with the small change; I suppose and hope @Star-Dust has no complaints and puts it in his first post :)

You know the answer to your question

In the majority it is not needed. If I find a sensible way I will insert it.

Please do not open or access the sources of my libraries. Even if it is a B4XLib library, it is not allowed to decompress it, modify it, change its name or redistribute it without the permission.
Already discussed with Erel, and not allowed. Otherwise we would have published the bas files.

B4xlib is published for these reasons:
1. Best for the compiler. Changing compiler version to older libraries versions may have problems. So there are no problems
2. You use only one file for all platforms and not one for single platform
3. In the case of B4i, if you use the Builder, you need to ask for permission from erel to build a library. With B4xLib it is not necessary

The latter reason is the main reason why I use the B4xLib.

P.S. It is clear that there is a risk, but going to publish changes as Oparra did seems excessive to me.
It's like stealing a neighbor's bike and walking in front of the window with the stolen bike .... At least hide ... Then if the neighbor calls the police, don't complain
 

LucaMs

Expert
Licensed User
Longtime User
You know the answer to your question
?

I hadn't read it. My intention, however, was to help a member of B4X at the time, quickly, knowing that the change would be useful to everyone and that you would have nothing against it.
I certainly didn't add that change for my personal interests.
I just made that microscopic change - change the visibility of mBase from private to public, and attached the changed library, so you could just grab it and attach it to your first post.

It wasn't really the case that you wrote that post!

Rest assured that I will never even touch one of your libraries again.
 

Star-Dust

Expert
Licensed User
Longtime User
?

I hadn't read it.
Thanks for your understanding, you already wrote about this in this thread. You probably don't remember it, but if you read on the first page you will find your interventions.

My intention, however, was to help a member of B4X at the time, quickly, knowing that the change would be useful to everyone and that you would have nothing against it ..... It wasn't really the case that you wrote that post!
I appreciate the good intention, but it would not be fair to @oparra if I had not given him permission but granted it to others.
I consider it necessary in compliance with what I asked @oparra

Rest assured that I will never even touch one of your libraries again.
Thanks for understanding.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
my library doesn't have this animation, but everything can be done but at the moment I don't have time
 
Top