android-advancedrecyclerview icon indicating copy to clipboard operation
android-advancedrecyclerview copied to clipboard

Dragging outside the recycler view

Open samiede opened this issue 8 years ago • 5 comments

Hi!

I'm using the drag and drop implementation, but now I want to implement deleting items by dragging them over a floating action button. I am, however, constrained to the bounds of the recycler view and can't figure out how to enable dragging items outside the recycler view. I have tried setting android:clipChildren="false" android:clipToPadding="false" in the parent view, but that doesn't seem to help. Is this behavior supported in the library? Thanks a lot!

samiede avatar Aug 14 '17 09:08 samiede

Add android:clipChildren="false" to the parent and android:clipToPadding="false" to the recyclerview.

My question is how to detect id of the view when drag&drop onto it?

ahulyk avatar Aug 14 '17 11:08 ahulyk

This doesn't work either, unfortunately.

I admit, I haven't thought that far at this point, I tried making the drag and drop work first ;)

My xml file looks like this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false">

<android.support.v7.widget.RecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    style="@style/myRecyclerViewStyle"
    android:clipToPadding="false"/>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/dashboard_fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    android:src="@drawable/ic_add_white" />

</FrameLayout>

samiede avatar Aug 14 '17 11:08 samiede

Strange, I use RelativeLayout as parent and it works for me

ahulyk avatar Aug 14 '17 11:08 ahulyk

Also doesn't work with Relative Layout as parent. I've tried setting the same in the example app for the draggable grid layout and it doesn't work there either.

samiede avatar Aug 14 '17 11:08 samiede

Add android:clipChildren="false" to the parent and android:clipToPadding="false" to the recyclerview.

My question is how to detect id of the view when drag&drop onto it?

I have same question. I can drag out side, but don't know how to get drop location Id ?

shubhq2 avatar Jul 12 '19 19:07 shubhq2