Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon shows through background of item #7

Open
sproctor opened this issue Apr 7, 2019 · 0 comments
Open

Icon shows through background of item #7

sproctor opened this issue Apr 7, 2019 · 0 comments

Comments

@sproctor
Copy link

sproctor commented Apr 7, 2019

To fix this, you can use a ClipDrawable.

val clip = ClipDrawable(deleteIcon, Gravity.RIGHT, ClipDrawable.HORIZONTAL)
clip.level = (-dX.toInt() - deleteIconMargin) * 10000 / deleteIcon.intrinsicWidth
clip.setBounds(deleteIconLeft, deleteIconTop, deleteIconRight, deleteIconBottom)
clip.draw(c)

instead of:

deleteIcon.draw(c)

Unrelated, but I don't feel like making another issue. For me it makes more sense to use itemView.paddingRight for the margin instead of that formula. I have some rows that are taller than others and it's strange if the icon position is different in each row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant