Skip to content

Commit 2693a01

Browse files
committed
Merge branch 'dev' into pr/n23_maxjspaulding
Conflicts: example/project.properties library/project.properties library/src/com/haarman/listviewanimations/itemmanipulation/contextualundo/ContextualUndoAdapter.java library/src/com/haarman/listviewanimations/itemmanipulation/contextualundo/ContextualUndoListViewTouchListener.java
2 parents 2747f41 + 38222d9 commit 2693a01

15 files changed

+663
-649
lines changed

example/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<uses-sdk
77
android:minSdkVersion="8"
8-
android:targetSdkVersion="17" />
8+
android:targetSdkVersion="18" />
99

1010
<application
1111
android:allowBackup="true"

example/res/drawable/img_nature1.jpg

4.33 KB
Loading

example/res/drawable/img_nature2.jpg

-11.1 KB
Loading

example/res/drawable/img_nature3.jpg

20.1 KB
Loading

example/res/drawable/img_nature4.jpg

6.32 KB
Loading

example/res/drawable/img_nature5.jpg

12.3 KB
Loading

library/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.haarman.listviewanimations"
3-
android:versionCode="1"
4-
android:versionName="1.0.0" >
3+
android:versionCode="14"
4+
android:versionName="2.1" >
55

66
<uses-sdk
77
android:minSdkVersion="8"
8-
android:targetSdkVersion="17" />
8+
android:targetSdkVersion="18" />
99

1010
</manifest>

library/src/com/haarman/listviewanimations/ArrayAdapter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import java.util.List;
2424

2525
/**
26-
* A true ArrayList adapter providing access to all ArrayList methods.
26+
* A true {@link ArrayList} adapter providing access to all ArrayList methods.
2727
*/
2828
public abstract class ArrayAdapter<T> extends BaseAdapter {
2929

30-
private ArrayList<T> mItems;
30+
private List<T> mItems;
3131

3232
/**
3333
* Creates a new ArrayAdapter with an empty list.
@@ -37,11 +37,11 @@ public ArrayAdapter() {
3737
}
3838

3939
/**
40-
* Creates a new ArrayAdapter with the specified list, or an empty list if
41-
* items == null.
40+
* Creates a new {@link ArrayAdapter} with a <b>copy</b> of the specified
41+
* list, or an empty list if items == null.
4242
*/
4343
public ArrayAdapter(List<T> items) {
44-
mItems = new ArrayList<T>();
44+
mItems = new ArrayList<T>();
4545
if (items != null) {
4646
mItems.addAll(items);
4747
}
@@ -93,7 +93,7 @@ public void addAll(Collection<? extends T> items) {
9393
* they are specified.
9494
*/
9595
public void addAll(T... items) {
96-
Collections.addAll(mItems, items);
96+
Collections.addAll(mItems, items);
9797
notifyDataSetChanged();
9898
}
9999

library/src/com/haarman/listviewanimations/BaseAdapterDecorator.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,14 @@ public BaseAdapterDecorator(BaseAdapter baseAdapter) {
3838
mDecoratedBaseAdapter = baseAdapter;
3939
}
4040

41-
@Deprecated
42-
/**
43-
* @deprecated use setAbsListView(AbsListView) instead.
44-
*/
45-
public void setListView(AbsListView listView) {
41+
public void setAbsListView(AbsListView listView) {
4642
mListView = listView;
4743

4844
if (mDecoratedBaseAdapter instanceof BaseAdapterDecorator) {
49-
((BaseAdapterDecorator) mDecoratedBaseAdapter).setListView(listView);
45+
((BaseAdapterDecorator) mDecoratedBaseAdapter).setAbsListView(listView);
5046
}
5147
}
5248

53-
public void setAbsListView(AbsListView listView){
54-
mListView = listView;
55-
56-
if (mDecoratedBaseAdapter instanceof BaseAdapterDecorator) {
57-
((BaseAdapterDecorator) mDecoratedBaseAdapter).setAbsListView(listView);
58-
}
59-
}
60-
61-
@Deprecated
62-
public AbsListView getListView(){
63-
return mListView;
64-
}
65-
6649
public AbsListView getAbsListView() {
6750
return mListView;
6851
}

library/src/com/haarman/listviewanimations/itemmanipulation/AnimateDismissAdapter.java

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,41 @@
3333
import com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener;
3434

3535
/**
36-
* A BaseAdapterDecorator class that provides animations to the removal of items
37-
* in the given BaseAdapter.
36+
* A {@link BaseAdapterDecorator} class that provides animations to the removal
37+
* of items in the given {@link BaseAdapter}.
3838
*/
3939
public class AnimateDismissAdapter<T> extends BaseAdapterDecorator {
4040

4141
private OnDismissCallback mCallback;
4242

4343
/**
44-
* Create a new AnimateDismissAdapter based on the given ArrayAdapter.
44+
* Create a new AnimateDismissAdapter based on the given {@link BaseAdapter}
45+
* .
4546
*
4647
* @param callback
47-
* The callback to trigger when the user has indicated that she
48-
* would like to dismiss one or more list items.
48+
* The {@link OnDismissCallback} to trigger when the user has
49+
* indicated that she would like to dismiss one or more list
50+
* items.
4951
*/
5052
public AnimateDismissAdapter(BaseAdapter baseAdapter, OnDismissCallback callback) {
5153
super(baseAdapter);
5254
mCallback = callback;
5355
}
5456

55-
public void animateDismiss(int index) {
56-
animateDismiss(Arrays.asList(index));
57+
/**
58+
* Animate dismissal of the item at given position.
59+
*/
60+
public void animateDismiss(int position) {
61+
animateDismiss(Arrays.asList(position));
5762
}
5863

64+
/**
65+
* Animate dismissal of the items at given positions.
66+
*/
5967
public void animateDismiss(Collection<Integer> positions) {
6068
final List<Integer> positionsCopy = new ArrayList<Integer>(positions);
61-
if(getAbsListView() == null) {
62-
throw new IllegalStateException("Call setListView() on this AnimateDismissAdapter before calling setAdapter()!");
69+
if (getAbsListView() == null) {
70+
throw new IllegalStateException("Call setAbsListView() on this AnimateDismissAdapter before calling setAdapter()!");
6371
}
6472

6573
List<View> views = getVisibleViewsForPositions(positionsCopy);
@@ -81,20 +89,20 @@ public void animateDismiss(Collection<Integer> positions) {
8189
animatorSet.addListener(new AnimatorListener() {
8290

8391
@Override
84-
public void onAnimationStart(Animator arg0) {
92+
public void onAnimationStart(Animator animator) {
8593
}
8694

8795
@Override
88-
public void onAnimationRepeat(Animator arg0) {
96+
public void onAnimationRepeat(Animator animator) {
8997
}
9098

9199
@Override
92-
public void onAnimationEnd(Animator arg0) {
100+
public void onAnimationEnd(Animator animator) {
93101
invokeCallback(positionsCopy);
94102
}
95103

96104
@Override
97-
public void onAnimationCancel(Animator arg0) {
105+
public void onAnimationCancel(Animator animator) {
98106
}
99107
});
100108
animatorSet.start();
@@ -132,21 +140,21 @@ private Animator createAnimatorForView(final View view) {
132140
animator.addListener(new AnimatorListener() {
133141

134142
@Override
135-
public void onAnimationStart(Animator arg0) {
143+
public void onAnimationStart(Animator animator) {
136144
}
137145

138146
@Override
139-
public void onAnimationRepeat(Animator arg0) {
147+
public void onAnimationRepeat(Animator animator) {
140148
}
141149

142150
@Override
143-
public void onAnimationEnd(Animator arg0) {
151+
public void onAnimationEnd(Animator animator) {
144152
lp.height = 0;
145153
view.setLayoutParams(lp);
146154
}
147155

148156
@Override
149-
public void onAnimationCancel(Animator arg0) {
157+
public void onAnimationCancel(Animator animator) {
150158
}
151159
});
152160

0 commit comments

Comments
 (0)