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. 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));