Tintinabulator Zea
Tintinabulator Zea

Reputation: 2807

How to stagger imageViews freely around a layout? (pic included)

I want to stagger images or buttons around a layout in an artsy way so that they look like this wall

Any ideas on which layout to use or how to do this ?

Thanks for any help

or like this wall

Upvotes: 0

Views: 132

Answers (1)

Kamal
Kamal

Reputation: 1415

for this you can follow this.

1- Create a recycler view with staggered layoutmanager.

2- Every child of recycler view implements onDragListener. you will get onDragEnter and exit evnets from there.

3- call startDrag of view on long press of a view. Keep track of which child you are dragging.

4- on Drop event just swap the values.

This is just a thought. with some more logic around, you can implement this.

Upvotes: 1

Related Questions