@@ -29,9 +29,11 @@ protected void onCreate(Bundle savedInstanceState) {
29
29
30
30
sample1 = (SwipeLayout ) findViewById (R .id .sample1 );
31
31
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 );
35
37
sample1 .addRevealListener (R .id .delete , new SwipeLayout .OnRevealListener () {
36
38
@ Override
37
39
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
90
92
91
93
sample2 = (SwipeLayout ) findViewById (R .id .sample2 );
92
94
sample2 .setShowMode (SwipeLayout .ShowMode .LayDown );
93
- sample2 .setDragEdge (SwipeLayout .DragEdge .Right );
95
+ sample2 .addDrag (SwipeLayout .DragEdge .Right , sample2 . findViewWithTag ( "Bottom2" ) );
94
96
// sample2.setShowMode(SwipeLayout.ShowMode.PullOut);
95
97
sample2 .findViewById (R .id .star ).setOnClickListener (new View .OnClickListener () {
96
98
@ Override
@@ -129,7 +131,7 @@ public void onClick(View v) {
129
131
//sample3
130
132
131
133
sample3 = (SwipeLayout ) findViewById (R .id .sample3 );
132
- sample3 .setDragEdge (SwipeLayout .DragEdge .Top );
134
+ sample3 .addDrag (SwipeLayout .DragEdge .Top , sample3 . findViewWithTag ( "Bottom3" ) );
133
135
sample3 .addRevealListener (R .id .bottom_wrapper_child1 , new SwipeLayout .OnRevealListener () {
134
136
@ Override
135
137
public void onReveal (View child , SwipeLayout .DragEdge edge , float fraction , int distance ) {
0 commit comments