Skip to content

Commit 5ffd6a2

Browse files
committed
Merge branch 'master' of github.com:daimajia/AndroidSwipeLayout into linfaxin
2 parents 670863a + b68a08c commit 5ffd6a2

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

demo/src/main/java/com/daimajia/swipedemo/GridViewExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.widget.AdapterView;
88
import android.widget.GridView;
99

10-
import com.daimajia.swipe.implments.SwipeItemMangerImpl;
1110
import com.daimajia.swipe.util.Attributes;
1211
import com.daimajia.swipedemo.adapter.GridViewAdapter;
1312

demo/src/main/java/com/daimajia/swipedemo/ListViewExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import android.widget.Toast;
1818

1919
import com.daimajia.swipe.SwipeLayout;
20-
import com.daimajia.swipe.implments.SwipeItemMangerImpl;
2120
import com.daimajia.swipe.util.Attributes;
2221
import com.daimajia.swipedemo.adapter.ListViewAdapter;
2322

demo/src/main/java/com/daimajia/swipedemo/MyActivity.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ protected void onCreate(Bundle savedInstanceState) {
2929

3030
sample1 = (SwipeLayout) findViewById(R.id.sample1);
3131
sample1.setShowMode(SwipeLayout.ShowMode.PullOut);
32-
// sample1.setDragEdges(SwipeLayout.DragEdge.Left, SwipeLayout.DragEdge.Right, SwipeLayout.DragEdge.Top);
33-
// When using multiple drag edges it's a good idea to pass the ids of the views that you're using for the left, right, top bottom views (-1 if you're not using a particular view)
34-
sample1.setBottomViewIds(R.id.bottom_wrapper, R.id.bottom_wrapper_2, R.id.starbott, R.id.starbott);
32+
View starBottView = sample1.findViewById(R.id.starbott);
33+
sample1.addDrag(SwipeLayout.DragEdge.Left, sample1.findViewById(R.id.bottom_wrapper));
34+
sample1.addDrag(SwipeLayout.DragEdge.Right, sample1.findViewById(R.id.bottom_wrapper_2));
35+
sample1.addDrag(SwipeLayout.DragEdge.Top, starBottView);
36+
sample1.addDrag(SwipeLayout.DragEdge.Bottom, starBottView);
3537
sample1.addRevealListener(R.id.delete, new SwipeLayout.OnRevealListener() {
3638
@Override
3739
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
@@ -90,7 +92,7 @@ public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int
9092

9193
sample2 = (SwipeLayout) findViewById(R.id.sample2);
9294
sample2.setShowMode(SwipeLayout.ShowMode.LayDown);
93-
sample2.setDragEdge(SwipeLayout.DragEdge.Right);
95+
sample2.addDrag(SwipeLayout.DragEdge.Right, sample2.findViewWithTag("Bottom2"));
9496
// sample2.setShowMode(SwipeLayout.ShowMode.PullOut);
9597
sample2.findViewById(R.id.star).setOnClickListener(new View.OnClickListener() {
9698
@Override
@@ -129,7 +131,7 @@ public void onClick(View v) {
129131
//sample3
130132

131133
sample3 = (SwipeLayout) findViewById(R.id.sample3);
132-
sample3.setDragEdge(SwipeLayout.DragEdge.Top);
134+
sample3.addDrag(SwipeLayout.DragEdge.Top, sample3.findViewWithTag("Bottom3"));
133135
sample3.addRevealListener(R.id.bottom_wrapper_child1, new SwipeLayout.OnRevealListener() {
134136
@Override
135137
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {

demo/src/main/java/com/daimajia/swipedemo/RecyclerViewExample.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.app.ActionBar;
44
import android.app.Activity;
5-
import android.content.Context;
65
import android.content.Intent;
76
import android.os.Build;
87
import android.os.Bundle;

0 commit comments

Comments
 (0)