Skip to content

Commit 79bb4ec

Browse files
committed
Refactor. Stronger and easier.
1 parent b460d4d commit 79bb4ec

File tree

3 files changed

+300
-453
lines changed

3 files changed

+300
-453
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ 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);
32+
// sample1.setDragEdges(SwipeLayout.DragEdge.Left, SwipeLayout.DragEdge.Right, SwipeLayout.DragEdge.Top);
3333
// 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, SwipeLayout.EMPTY_LAYOUT);
34+
sample1.setBottomViewIds(R.id.bottom_wrapper, R.id.bottom_wrapper_2, R.id.starbott, R.id.starbott);
3535
sample1.addRevealListener(R.id.delete, new SwipeLayout.OnRevealListener() {
3636
@Override
3737
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {

demo/src/main/res/layout/main.xml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,10 @@
55
android:layout_width="match_parent"
66
android:layout_height="match_parent">
77
<ImageView
8-
android:id="@+id/bird_left"
9-
android:layout_gravity="left"
8+
android:layout_gravity="left|right|top"
109
android:src="@drawable/bird"
1110
android:layout_width="100dp"
12-
android:layout_height="match_parent" />
13-
<ImageView
14-
android:id="@+id/bird_right"
15-
android:layout_gravity="right"
16-
android:src="@drawable/bird"
17-
android:layout_width="100dp"
18-
android:layout_height="match_parent" />
19-
<LinearLayout
20-
android:id="@+id/bird_top"
21-
android:layout_gravity="top"
22-
android:gravity="center"
23-
android:layout_width="match_parent"
24-
android:layout_height="100dp">
25-
<ImageView
26-
android:src="@drawable/bird"
27-
android:layout_width="wrap_content"
28-
android:layout_height="wrap_content" />
29-
</LinearLayout>
11+
android:layout_height="100dp" />
3012
<LinearLayout
3113
android:id="@+id/bird_bottom"
3214
android:layout_gravity="bottom"

0 commit comments

Comments
 (0)