How do i drag and drop a view (not in a recyclerview) into a recycler view at x position?
How do i display a temporary view to show the user where the item will be inserted within the recycler view if they were to drop at their current position?
Should I be implementing prepareForDrop() or something similar to do this? Simple examples will be a great help if possible.
I currently have an ItemTouchHelper to handle the onMove and onSwiped methods for list items already within the recycler view but don't know how to implement dropping a view from outside the recycler view into the recycler view itself.
Thanks
Related
I am trying to have a recycler view , which has another recycler view as its child ! i have successfully made the drag and drop work , but am stuck with how do i make the recycler view scroll - when the item has reached the top !
In onDrag :
event.y resets when i cross EVERY OTHER CHILD of the child's recycler view
v.y is also based on the children of the inner recycler view ! i have no way of knowing where the child is at WITH RESPECT to the parent/main recycler view
I am using recycler view with linear layout manager, based on some logic I am hiding/showing a view inside recycler view item.
Issue Problem occurs when I scroll, I can see some gaps in between recycler view item, which are random when scroll. If I hide the view always , then there is no issue, but I need to show and hide based on some logic and when implemented the gaps are coming as well.
Assumption One thing I am sure of is that the issue is there because of hiding/showing a view.
can we use scroll view in list view I am getting confusion in that, when we are using list view then only we get scroll view. that's why i'm getting confusion.
I want to have a view inside a scrollable layout (Recyclerview with GridlayoutManager) with tiles (Views) in it. Dragging and dropping an item to RecyclerView.
Check this for drag and drop in recycler view.
https://medium.com/#ipaulpro/drag-and-swipe-with-recyclerview-6a6f0c422efd#.yt2erbko9
To know about drop event check this issue.
Update
For external views drag event check this.
So to be clear, I can solve this with a header view and trickiness, but I'd rather not.
I'd like to have a set of tabs (which also contains some profile information) above a view pager, which could have multiple pages, where each page has a list view. I'd like when you start scrolling initially, that the above tab / profile view will move with the list view (so if you try scrolling the list view, the area above scrolls up) and once the listview is scrolled down until it is at the first item, that the above view starts to scroll back into view.
This is not solveable with a header view, as far as I can tell, without stuffing this profile / tab view into the header of every list view the view pager holds, and to keep them in sync (which just sounds silly).
I feel there's a way I can make use of onInterceptTouchEvent with a custom layout / scrollview of sorts, any tips on doing this?