android - Drag and Drop view outside of Recyclerview -
what want achieve: want have view inside scrollable layout (recyclerview
gridlayoutmanager
) tiles (views) in it. dragging , dropping item inside of recyclerview
should adjust position of icon , swap other elements. when drag starts, icon above recyclerview
change trash icon , dragging view icon delete recyclerview
.
i tried excellent tutorial, didn't find way how handle dragging outside of recyclerview
itemtouchhelper.callback
uses recycler.viewholder
elements possible targets.
the method interpolateoutofboundsscroll()
gives feedback if view moves out of boundaries, give total size offscreen, no coordinates. also, trying drag view out of recyclerview
results in cutting of view passes borders of recyclerview
.
does have idea how achieve effect?
you bound recyclerview
boundries. have several options:
make
recyclerview
's layout heightmatch_parent
, on top of upper view (istoolbar
?) , add sticky header of same size , have empty transparent layout. way drag ther , see item floating on there.instead of dragging item garbage can icon located close legitemate upper-right item, make long click select item (and apply signal check mark or red mask) , make garbage can appear , delete uppon click (and maybe allow multi item deleting)
Comments
Post a Comment