From 25124c555c9d6ced81ce3e78b3d8a0e02fc274ce Mon Sep 17 00:00:00 2001 From: Niek Haarman Date: Mon, 16 Mar 2015 19:01:54 +0100 Subject: [PATCH 1/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30803187..1af348f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,10 @@ When describing an issue, be precise: * What happened? What do you think should have happened? * On what Android version does this issue occur? +# Asking Questions + +Asking questions should preferably be done on a dedicated forum such as [StackOverflow](http://stackoverflow.com/). This is an issue tracker after all. + # Contributing code ## Please do! @@ -32,4 +36,4 @@ I'm happy to view and accept pull requests. However, it is important to follow t * **Do not** put any `@author` comment. Git keeps track of all your changes and `@author` does more harm than good. * **Do not** issue a pull request into the `master` branch. * Try to keep the diff as small as possible. For example, be aware of auto formatting. -* All files should have the Apache 2 License header. \ No newline at end of file +* All files should have the Apache 2 License header. From 05a1805c6b711815a491221af4e3b2b1709f9c85 Mon Sep 17 00:00:00 2001 From: Anthony Tripaldi Date: Thu, 23 Apr 2015 14:10:15 -0400 Subject: [PATCH 2/2] adding removeAll to more closely mirror arraylist methods for uses where u need to remove more than one object at a time prior to notifying data set changes --- .../nhaarman/listviewanimations/ArrayAdapter.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib-core/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java b/lib-core/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java index 56cb9dd3..9499ec14 100644 --- a/lib-core/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java +++ b/lib-core/src/main/java/com/nhaarman/listviewanimations/ArrayAdapter.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Iterator; import java.util.List; /** @@ -136,6 +137,20 @@ public T remove(final int location) { return result; } + public boolean removeAll(@NonNull Collection c) { + boolean modified = false; + Iterator e = this.mItems.iterator(); + while (e.hasNext()) { + if (c.contains(e.next())) { + e.remove(); + modified = true; + } + } + if(modified) + this.notifyDataSetChanged(); + return modified; + } + @Override public void swapItems(final int positionOne, final int positionTwo) { T firstItem = mItems.set(positionOne, getItem(positionTwo));