I improved my version of the lib. You can find it a few posts above.
What's new: the RippleView is a view like any other B4A view, with all functions and properties, and I added the Zoom feature, which was there but not used.
The RippleView object is a panel with a single view inside. You can retrieve the embedded view with the View property.
How to use this lib:
What's new: the RippleView is a view like any other B4A view, with all functions and properties, and I added the Zoom feature, which was there but not used.
The RippleView object is a panel with a single view inside. You can retrieve the embedded view with the View property.
How to use this lib:
- If you load a layout:
You load the layout, you create an instance of RippleView (you could do that in Globals) and you initialize this instance.
In this example, I load a layout with a button and I apply the ripple effect on the button:
B4X:Activity.LoadLayout("mylayout") Dim rv As RippleView rv.Initialize(Button1, Colors.Red, 200, True)
- If you create your views by code:
You can do like I explained above, after you added the view to its parent. If you cannot add the view to its parent (for example, when you pass this view to a class or library that will add it for you), you create the view, you create an instance of RippleView and you initialize this instance as usual, then you pass this instance to the class/library that will add it, instead of the view. Example:
B4X:Dim Button1 As Button Button1.Initialize("") Button1.Text = "Click me" Dim rv As RippleView rv.Initialize(Button1, Colors.Red, 200, True) DialogCreator(rv) 'Here, I pass my RippleView, not the Button
Last edited: