Skip to content

Instantly share code, notes, and snippets.

@keinix
Last active September 12, 2018 11:38
Show Gist options
  • Save keinix/d620b73b4c613645f64908d726d1982b to your computer and use it in GitHub Desktop.
Save keinix/d620b73b4c613645f64908d726d1982b to your computer and use it in GitHub Desktop.
if (dX > 0) { // Swiping to the right
background.setBounds(itemView.getLeft(), itemView.getTop(),
itemView.getLeft() + ((int) dX) + backgroundCornerOffset,
itemView.getBottom());
} else if (dX < 0) { // Swiping to the left
background.setBounds(itemView.getRight() + ((int) dX) - backgroundCornerOffset,
itemView.getTop(), itemView.getRight(), itemView.getBottom());
} else { // view is unSwiped
background.setBounds(0, 0, 0, 0);
}
background.draw(c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment