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.

initial statestarting drag view5dragging view5 trash iconview5 deleted , other views moved along

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:

  1. make recyclerview's layout height match_parent , on top of upper view (is toolbar?) , add sticky header of same size , have empty transparent layout. way drag ther , see item floating on there.

  2. 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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -