Skip to content

Commit 739f317

Browse files
committed
Merge branch 'fling-or-slide-remove'
Conflicts: library/src/com/mobeta/android/dslv/DragSortListView.java
2 parents ef48c2a + ebc4ea7 commit 739f317

File tree

13 files changed

+480
-385
lines changed

13 files changed

+480
-385
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Changelog
22
=========
33

4+
0.6.0
5+
-----
6+
7+
* Remove modes are now `fling_remove` and `click_remove`.
8+
9+
0.5.0
10+
-----
11+
12+
* Multiple-choice and single-choice selections handled.
13+
414
0.4.0
515
-----
616

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ DragSortListView
44
News
55
----
66

7+
**Feb. 9, 2013**: Version 0.6.0. Consolidated remove modes to
8+
`click_remove` and `fling_remove`. No more fling remove while
9+
dragging; fling anywhere on item to remove it.
10+
[Leszek Mzyk](https://github.com/imbryk) is a bona fide code-slanger.
11+
712
**Jan. 10, 2013**: Version 0.5.0 is released. Supports ListView
813
multi-choice and single-choice modes thanks to the hard work of
914
[Mattias Flodin](https://github.com/mattiasflodin)! Awesome-sauce.
@@ -152,16 +157,16 @@ of 1 means items snap from position to position without animation.
152157
* `remove_mode`: (enum, "flingRight") Sets the gesture for removing the
153158
dragged item.
154159
+ "clickRemove": Click on item child View with id `click_remove_id`.
155-
+ "flingRight": Fling to the right; get outta here!
156-
+ "flingLeft": Fling to the left; sayonara sucker!
157-
+ "slideRight": Floating View fades as you slide your finger
158-
to the right; lifting while faded removes item.
159-
+ "slideLeft": Floating View fades as you slide your finger
160-
to the right; lifting while faded removes item.
160+
+ "flingRemove": Fling horizontal anywhere on item.
161161
* `click_remove_id`: (id, 0) Android resource id that points to a
162162
child View of a list item. When `remove_mode="clickRemove"` and
163163
`remove_enabled="true"`, a click on this child View removes the
164164
containing item. This attr is used by DragSortController.
165+
* `fling_handle_id`: (id, 0) Android resource id that points to a
166+
child View of a list item. When `remove_mode="flingRemove"` and
167+
`remove_enabled="true"`, a fling that originates on this child
168+
View removes the containing item. This attr is used by
169+
DragSortController.
165170

166171
### Listeners
167172

@@ -355,7 +360,7 @@ dependency to your pom.xml:
355360
<dependency>
356361
<groupId>com.mobeta.android.dslv</groupId>
357362
<artifactId>drag-sort-listview</artifactId>
358-
<version>0.3.0-SNAPSHOT</version>
363+
<version>0.6.0-SNAPSHOT</version>
359364
<type>apklib</type>
360365
</dependency>
361366
```

demo/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Copyright 2012 Andreas Schildbach
2020
<parent>
2121
<groupId>com.mobeta.android.dslv</groupId>
2222
<artifactId>parent</artifactId>
23-
<version>0.5.0-SNAPSHOT</version>
23+
<version>0.6.0-SNAPSHOT</version>
2424
<relativePath>../pom.xml</relativePath>
2525
</parent>
2626

2727
<groupId>com.mobeta.android.demodslv</groupId>
2828
<artifactId>drag-sort-listview-demo</artifactId>
2929
<packaging>apk</packaging>
30-
<version>0.5.0-SNAPSHOT</version>
30+
<version>0.6.0-SNAPSHOT</version>
3131

3232
<dependencies>
3333
<dependency>

demo/res/layout/hetero_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
dslv:sort_enabled="true"
2323
dslv:remove_enabled="true"
2424
dslv:drag_start_mode="onDown"
25-
dslv:remove_mode="flingLeft" />
25+
dslv:remove_mode="flingRemove" />

demo/res/values/strings.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@
5757
<string name="add_footer">Add footer</string>
5858
<string-array name="remove_mode_labels">
5959
<item>Click remove</item>
60-
<item>Fling right</item>
61-
<item>Fling left</item>
62-
<item>Slide right</item>
63-
<item>Slide left</item>
60+
<item>Fling remove</item>
6461
</string-array>
6562
<string-array name="drag_init_mode_labels">
6663
<item>On down</item>

demo/src/com/mobeta/android/demodslv/DSLVFragment.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ protected int getLayout() {
5353
* Return list item layout resource passed to the ArrayAdapter.
5454
*/
5555
protected int getItemLayout() {
56-
if (removeMode == DragSortController.FLING_LEFT_REMOVE || removeMode == DragSortController.SLIDE_LEFT_REMOVE) {
56+
/*if (removeMode == DragSortController.FLING_LEFT_REMOVE || removeMode == DragSortController.SLIDE_LEFT_REMOVE) {
5757
return R.layout.list_item_handle_right;
58-
} else if (removeMode == DragSortController.CLICK_REMOVE) {
58+
} else */
59+
if (removeMode == DragSortController.CLICK_REMOVE) {
5960
return R.layout.list_item_click_remove;
6061
} else {
6162
return R.layout.list_item_handle_left;
@@ -67,7 +68,7 @@ protected int getItemLayout() {
6768

6869
public int dragStartMode = DragSortController.ON_DOWN;
6970
public boolean removeEnabled = false;
70-
public int removeMode = DragSortController.FLING_RIGHT_REMOVE;
71+
public int removeMode = DragSortController.FLING_REMOVE;
7172
public boolean sortEnabled = true;
7273
public boolean dragEnabled = true;
7374

demo/src/com/mobeta/android/demodslv/RemoveModeDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class RemoveModeDialog extends DialogFragment {
2121

2222
public RemoveModeDialog() {
2323
super();
24-
mRemoveMode = DragSortController.FLING_RIGHT_REMOVE;
24+
mRemoveMode = DragSortController.FLING_REMOVE;
2525
}
2626

2727
public RemoveModeDialog(int inRemoveMode) {

demo/src/com/mobeta/android/demodslv/TestBedDSLV.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class TestBedDSLV extends FragmentActivity implements
2727
private int mNumHeaders = 0;
2828
private int mNumFooters = 0;
2929

30-
private int mDragStartMode = DragSortController.ON_DOWN;
31-
private boolean mRemoveEnabled = false;
32-
private int mRemoveMode = DragSortController.FLING_RIGHT_REMOVE;
30+
private int mDragStartMode = DragSortController.ON_DRAG;
31+
private boolean mRemoveEnabled = true;
32+
private int mRemoveMode = DragSortController.FLING_REMOVE;
3333
private boolean mSortEnabled = true;
3434
private boolean mDragEnabled = true;
3535

library/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Copyright 2012 Andreas Schildbach
2020
<groupId>com.mobeta.android.dslv</groupId>
2121
<artifactId>drag-sort-listview</artifactId>
2222
<packaging>apklib</packaging>
23-
<version>0.5.0-SNAPSHOT</version>
23+
<version>0.6.0-SNAPSHOT</version>
2424

2525
<parent>
2626
<groupId>com.mobeta.android.dslv</groupId>
2727
<artifactId>parent</artifactId>
28-
<version>0.5.0-SNAPSHOT</version>
28+
<version>0.6.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

library/res/values/dslv_attrs.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
<attr name="float_background_color" format="color" />
88
<attr name="remove_mode">
99
<enum name="clickRemove" value="0" />
10-
<enum name="flingRight" value="1" />
11-
<enum name="flingLeft" value="2" />
12-
<enum name="slideRight" value="3" />
13-
<enum name="slideLeft" value="4" />
10+
<enum name="flingRemove" value="1" />
1411
</attr>
1512
<attr name="track_drag_sort" format="boolean"/>
1613
<attr name="float_alpha" format="float"/>
@@ -26,6 +23,7 @@
2623
<enum name="onLongPress" value="2"/>
2724
</attr>
2825
<attr name="drag_handle_id" format="integer" />
26+
<attr name="fling_handle_id" format="integer" />
2927
<attr name="click_remove_id" format="integer" />
3028
<attr name="use_default_controller" format="boolean" />
3129
</declare-styleable>

0 commit comments

Comments
 (0)