mikepenz / FastAdapter

The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
https://mikepenz.dev
Apache License 2.0
3.84k stars 494 forks source link

Can I Swipe item view then remain it's state then delete button can click #1054

Open sontnfabbi opened 5 months ago

sontnfabbi commented 5 months ago

It is not an issue, but i wonder that lib can do it. Can I Swipe item view then remain it's state then delete button can click or continue swipe to delete that item. my image like that lib: https://github.com/daimajia/AndroidSwipeLayout


 // add swipe as well
        val leaveBehindDrawableLeft = context.getDrawable(R.drawable.ic_delete)
        val callback = object : SimpleSwipeCallback.ItemSwipeCallback {
            override fun itemSwiped(position: Int, direction: Int) {
                logi("itemSwiped $position, $direction")

            }
        }
        val touchCallback = SimpleSwipeCallback(
            callback,
            leaveBehindDrawableLeft
        )
        val touchHelper = ItemTouchHelper(touchCallback) // Create ItemTouchHelper
        touchHelper.attachToRecyclerView(findviewbyId(R.id.recyclerView)) // Attach ItemTouchHelper to RecyclerView`

Details

Checklist

mikepenz commented 5 months ago

The library offers some utils related to swipe of items. best checkout the sample app to see if you can find what you be looking for.

sontnfabbi commented 5 months ago

The library offers some utils related to swipe of items. best checkout the sample app to see if you can find what you be looking for.

@mikepenz I tried all sample but its not work that why I must to ask this post.