buildscript {
...
repositories {
...
mavenCentral()
jcenter()
maven { url 'https://dl.bintray.com/stevechulsdev/maven/' }
}
dependencies {
...
}
}
allprojects {
repositories {
...
mavenCentral()
jcenter()
maven { url 'https://dl.bintray.com/stevechulsdev/maven/' }
}
}
dependencies {
...
implementation 'com.stevechulsdev.android:recycler-swipe:1.0.0@aar'
}
@param Icon Resource
@param Icon Width
@param Icon Height
@param Button Width
@param Button Background Color
@param UnderlayButtonClickListener
@param Context
object : StevechulsSwipeHelper(this, recycler) {
override fun instantiateUnderlayButton(
viewHolder: RecyclerView.ViewHolder,
underlayButtons: MutableList) {
// one button
underlayButtons.add(
UnderlayButton(R.drawable.icon_garbage, 250, 250, 200,
Color.parseColor("#e5001b"),
UnderlayButtonClickListener { pos ->
recycler.adapter?.notifyItemChanged(pos)
adapter.removeItemToSwipe(pos)
}, this@MainActivity
)
)
// two button
underlayButtons.add(
UnderlayButton(R.drawable.icon_garbage, 250, 250, 200,
Color.parseColor("#e5001b"),
UnderlayButtonClickListener { pos ->
recycler.adapter?.notifyItemChanged(pos)
adapter.removeItemToSwipe(pos)
}, this@MainActivity
)
)
}
}