B4A Library Ripple Effect library

This library wraps this open source project: https://github.com/patrickpissurno/RippleEffect
License: https://github.com/patrickpissurno/RippleEffect/blob/master/LICENSE.txt
You can use it to add ripple effects to views:

demo.gif

SS-2017-04-02_09.46.32.png

(image taken from the open source documentation)

It is simple to use it. See the included example.

If you are applying this effect to a view that is added by code then you need to first add the view to its parent and then add the effect.
 

Attachments

  • RippleEffect.zip
    8.9 KB · Views: 1,333
  • Example.zip
    8.8 KB · Views: 1,106
Last edited:

ivan.tellez

Active Member
Licensed User
Longtime User
The animation is asynchronous. It shouldn't be affected by the code execution.

This is not really true, the ripple will pause until the code in the click event finishes. I try CallSubDelayed and DoEvents, but with the same result.

The other Bug, if you use this for hide and show views, the ripple wil be paused, and then started when the view is visible again.


There are 2 bugs, or maybe I'm Doing something wrong. Can you please check the test code to confirm this?

Use the middle buttons to check the asynchronous animation problem, and the side buttons to thest the problem when the view is hided.

Thanks
 

Attachments

  • RippleTest.zip
    10 KB · Views: 381

bluedude

Well-Known Member
Licensed User
Longtime User
I think the ripple effect isn't that useful. Tried it on a button but the user does not always see the effect because the button click event immediately executes. Why bother to have a ripple effect if the user does not notice it?

So either it needs to wait executing and show or we don't need it because it makes no sense. I noticed when I start for example my barcode scanner that the effect started after getting back to my app.

It is a cool effect but only when it is applied at the right moment.
 

Ian Garton

Member
Licensed User
Longtime User
Unfortunately this library seems to error on Convert Byte Code if used in conjunction with the MSMaterialMenu library.
B4X:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/andexert/library/RippleView$1;
    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:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
 

ivan.tellez

Active Member
Licensed User
Longtime User
i dont understand why that would be a problem

Well, the app will look really bad. If you had some code on the button, the ripple will be paused until the code in the button ends. Normally will be a little pause (still looks bad, as in a not responsive app) but if your code is heavy, the ripple will be paused a log time. When you have multiple Activities, and the ripple pauses with the activity and continues when you return.

Check the sample project on the post #41.
 
Last edited:

thedesolatesoul

Expert
Licensed User
Longtime User
The app will look really badwhen you have multiple Activities, and the ripple pauses with the activity and continues when you return. Or if your button has some heavi code, the ripple will pause.

Check the sample project on the post #41.
I see. Not quite sure how that can be solved without as they both (event and ripple) need to be run on the same UI thread except maybe ensure the event is raised afterwards.
 

ivan.tellez

Active Member
Licensed User
Longtime User
I forgot a example. Its a common practice to use multiple panels and hide/show them in an app. If you have a button to show another panel the ripple will be paused when the panel hides, then if you show the panel again, the ripple will continue o_O

Not quite sure how that can be solved without as they both (event and ripple) need to be run on the same UI

yea, its a complicated issue.
 

ArminKH

Well-Known Member
@Informatix
hi
the modiffied version of ripple effect which is created by thedesolatesoul has a method named "SetRippleType"
can u please add this to your lib?
and also i have an isue
for example i have a panel and a button in this panel
now i set ripple effect by using your lib to this button
when user clicked on this button the ripple effect appared but into this sub("B_Click")i have a small code which set "Panel1.Visible=False"
now when user is going to click on this button at first ripple effect appared for a bit and this my panel hide and ripple effect not completely finished
and for next isue when i want to set Panel1.Visible=True after hiding that the ripple view continue from last stopped place!!!!
please help me informatix
thank u
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
@Informatix
hi
the modiffied version of ripple effect which is created by thedesolatesoul has a method named "SetRippleType"
can u please add this to your lib?
and also i have an isue
for example i have a panel and a button in this panel
now i set ripple effect by using your lib to this button
when user clicked on this button the ripple effect appared but into this sub("B_Click")i have a small code which set "Panel1.Visible=False"
now when user is going to click on this button at first ripple effect appared for a bit and this my panel hide and ripple effect not completely finished
and for next isue when i want to set Panel1.Visible=True after hiding that the ripple view continue from last stopped place!!!!
please help me informatix
thank u
If I remember well, there's a property to change the type in my library. Anyway, this is not a work I want to maintain or update as I don't use it at all. It seems there are issues with the ripple effect implemented this way (in all available libs of this thread), like the one you reported, so it should probably be rewritten, which requires too much time. Sorry.
 

ArminKH

Well-Known Member
If I remember well, there's a property to change the type in my library. Anyway, this is not a work I want to maintain or update as I don't use it at all. It seems there are issues with the ripple effect implemented this way (in all available libs of this thread), like the one you reported, so it should probably be rewritten, which requires too much time. Sorry.
ok
any way if any time you decide to improve this library please add RippleEffect_EffectFinished Event too if is possible
for now i'm using a timer to handle this problem and also we can use AnimationPlus lib(Start Offset) to fix related problems
thank u informatix for sharing your experiences
;)
 
Top