Last active
August 29, 2015 14:14
-
-
Save Gofilord/c8768ae523d51b80673e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onCreate(...) { | |
... | |
SwipeDismissListViewTouchListener.DismissCallbacks dismissCallbacks = new SwipeDismissListViewTouchListener.DismissCallbacks() { | |
@Override | |
public boolean canDismiss(int position) { | |
return true; | |
} | |
@Override | |
public void onDismiss(ListView listView, int[] reverseSortedPositions) { | |
for (int position : reverseSortedPositions) | |
removeHero(position); | |
// update the list view | |
list.setAdapter(adapter); | |
// notify the user by a toast | |
Toast toast = Toast.makeText(MainActivity.this, "Removed", Toast.LENGTH_SHORT); | |
toast.show(); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment