Hey guys, I am writing a general ItemTouchHelper f...
# android
a
Hey guys, I am writing a general ItemTouchHelper for our RecyclerView that is capable of drawing a background and an icon when the user swipes an item on the recyclerview. The drawing code is as follows where c is the canvas that is provided to us by overriding the
onChildDraw
method for a
ItemTouchHelper.SimpleCallback
class. My question is how does one write an espresso test to ensure that something that was suppose to be drawn on the canvas get’s drawn. I’ve already gotten to the point where I can make the espresso test do the swipe however, not sure how to correct make a view assertion. Any help would be appreciated.
Copy code
c.drawRect(
            itemView.left.toFloat(),
            itemView.top.toFloat(),
            itemView.left.toFloat() + dX,
            itemView.bottom.toFloat(),
            paint
        )
        c.drawBitmap(
            actionBitmap,
            itemView.left.toFloat() + bitmapWidth + 96f,
            itemView.top.toFloat() + backgroundHeight,
            null
        )
😶 2