Refactor. Stronger and easier.
This commit is contained in:
parent
b460d4dd47
commit
79bb4ecb36
|
|
@ -29,9 +29,9 @@ public class MyActivity extends Activity {
|
|||
|
||||
sample1 = (SwipeLayout) findViewById(R.id.sample1);
|
||||
sample1.setShowMode(SwipeLayout.ShowMode.PullOut);
|
||||
sample1.setDragEdges(SwipeLayout.DragEdge.Left, SwipeLayout.DragEdge.Right, SwipeLayout.DragEdge.Top);
|
||||
// sample1.setDragEdges(SwipeLayout.DragEdge.Left, SwipeLayout.DragEdge.Right, SwipeLayout.DragEdge.Top);
|
||||
// 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)
|
||||
sample1.setBottomViewIds(R.id.bottom_wrapper, R.id.bottom_wrapper_2, R.id.starbott, SwipeLayout.EMPTY_LAYOUT);
|
||||
sample1.setBottomViewIds(R.id.bottom_wrapper, R.id.bottom_wrapper_2, R.id.starbott, R.id.starbott);
|
||||
sample1.addRevealListener(R.id.delete, new SwipeLayout.OnRevealListener() {
|
||||
@Override
|
||||
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
|
||||
|
|
|
|||
|
|
@ -5,28 +5,10 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/bird_left"
|
||||
android:layout_gravity="left"
|
||||
android:layout_gravity="left|right|top"
|
||||
android:src="@drawable/bird"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent" />
|
||||
<ImageView
|
||||
android:id="@+id/bird_right"
|
||||
android:layout_gravity="right"
|
||||
android:src="@drawable/bird"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent" />
|
||||
<LinearLayout
|
||||
android:id="@+id/bird_top"
|
||||
android:layout_gravity="top"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp">
|
||||
<ImageView
|
||||
android:src="@drawable/bird"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
android:layout_height="100dp" />
|
||||
<LinearLayout
|
||||
android:id="@+id/bird_bottom"
|
||||
android:layout_gravity="bottom"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue