Organize your code in such a way that, upon adding this decoration to the RecyclerView, the icon gets rendered.
ItemDecoration
Add an icon
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
iconDrawable.draw(c)
for (i in 0 until parent.childCount) {
child.left + iconSizeInDp, child.top + iconSizeInDp
val child = parent.getChildAt(i)
}
override fun onDrawOver(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
}
}
class IconItemDecoration(private val iconDrawable: Drawable, private val iconSizeInDp: Int) : RecyclerView.ItemDecoration() {
iconDrawable.setBounds(
child.left, child.top,
)
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.