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,187
  • Example.zip
    8.8 KB · Views: 949
Last edited:

Informatix

Expert
Licensed User
Longtime User
When you apply this effect to a view, the view class becomes com.andexert.library.RippleView, which is a big problem. You cannot do things like:
Dim lbl As Label = CellPanel.GetView(0) -> ClassCastException
or
If View Is Label then...
You should add a method allowing to retrieve the wrapped object.
 

woniol

Active Member
Licensed User
Longtime User
Is StdActionBar (Standard ActionBar) library used on this demo video ?
 

corwin42

Expert
Licensed User
Longtime User
A comment from Chris Banes (Android Developer and responsible for large parts of the new android-support-v7-appcompat library) on this ripple effect library:

Ripples are highly dependent on Lollipop's new RenderThread for performance. As devices before that do not have RT, the performance will be bad.
 

Informatix

Expert
Licensed User
Longtime User
A comment from Chris Banes (Android Developer and responsible for large parts of the new android-support-v7-appcompat library) on this ripple effect library:
I'd like to see a case where the performance is really bad. Even the slow official emulator displays a smooth animation. Maybe if you trigger many ripples at the same time, which should not happen, on a very cheap and old device... It seems that's just a very theoretical point of view.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Last edited:

johndb

Active Member
Licensed User
Longtime User
It would appear that this RippleEffect library is not compatible with Informatix's GestureDetector library. Gestures are not passed along by the RippleEffect.
 

Informatix

Expert
Licensed User
Longtime User
It would appear that this RippleEffect library is not compatible with Informatix's GestureDetector library. Gestures are not passed along by the RippleEffect.
In fact, the RippleView is a bit cumbersome to use but should work with everything. With GestureDetector, you have to bind the GD to the RippleView. And when you want to move the view concerned by the gesture, you have to move the RippleView instead. Since it has no left or right property, you have to convert it to a panel first.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Would it be better to write it in a way where you construct the view hierarchy bottom to top?
i.e. Add a RippleLayer or RipplePanel to an activity first, and then add the view onto this. This way you dont need to un-parent the view.
I am not saying it is a better way, but I have always been unsure which way is better. (Personally I prefer to 'attach' views, but that is a minefield for errors if things are not done in sequence).
 

Informatix

Expert
Licensed User
Longtime User
Here's a modified version of the RippleEffect lib.
It works with any Android version, it can return the view embedded within the RippleView, the ripple effect can be added before or after the view is added to its parent (if you do it before, then it's the RippleView that has to be added to a parent view) and the RippleView is now a view as any other view, with all properties and functions of a B4A view. I also added the Zoom feature, included in the original library, and two new settings for the ripple effect: type and padding (see the Ripple function).

How to use it
 

Attachments

  • RippleEffect13.zip
    12.1 KB · Views: 756
Last edited:

johndb

Active Member
Licensed User
Longtime User
Thank you Informatix. I'll try it later today when I get back to the office.
I tried various combinations with the initial library: RippleView before view creation, after view creation and didn't play nice with your GestureDetector. I hope your revised version works. The effect isn't essential for my software but it would be nice feature to have ;)
 

Informatix

Expert
Licensed User
Longtime User
Thank you Informatix. I'll try it later today when I get back to the office.
I tried various combinations with the initial library: RippleView before view creation, after view creation and didn't play nice with your GestureDetector. I hope your revised version works. The effect isn't essential for my software but it would be nice feature to have ;)
The Erel's version works with GestureDetector but you have to do what I explained in post #16.
EDIT: I posted an example with GD here.
 
Last edited:
Top