StackView icon indicating copy to clipboard operation
StackView copied to clipboard

How to get the swiped card direction, whether it's swiped left or right ?

Open aliraza96 opened this issue 5 months ago • 0 comments

How to get the swiped card direction, whether it's swiped left or right ?

There's no method to get the swipe direction. Only method available is this

binding.stackLayout.onChangeListener = object : OnChangeListener { override fun onChange(remainingCardsCount: Int, totalCardsCount: Int) { //Log.d("StackView", "remainingCardsCount :: $remainingCardsCount, totalCardsCount :: $totalCardsCount") if (remainingCardsCount < totalCardsCount) {

                // Get the item that was just swiped
                val swipedItem = allPhotos[currentItemIndex]

                // Print the swiped item
                Toast.makeText(this@PhotoSwipeActivity, "The currently swiped item is: ${swipedItem.name}", Toast.LENGTH_SHORT).show()

                // Increment the counter to track the next item
                currentItemIndex++
            }
        }
    }

No way to figure out the swiped direction.

aliraza96 avatar Aug 07 '25 06:08 aliraza96