Open danvass opened 9 years ago
My current solution is keeping a track of all SwipeListeners and removing them and adding the one I need.
I did it this way (in kotlin code) but it would be great if someone could either implement the setSwipeListener or the clearAllSwipeListeners
import android.content.Context
import android.util.AttributeSet
import com.daimajia.swipe.SwipeLayout
class CustomSwipeLayout(context: Context, attr: AttributeSet) : SwipeLayout(context, attr){
var prev:SwipeListener? = null
fun setSwipeListener(s: SwipeListener){
if(prev != null){
println("self broadcast duplicate listenenr")
removeSwipeListener(prev)
prev = null
}
addSwipeListener(s)
prev = s
}
}
Is there a way to setSwipeListener instead of addSwipeListener? I'm trying to use it in an ArrayAdapter but I need to set the swipe listener in getView instead of adding new ones.
Thanks, Daniel