Refactor. Stronger and easier.

This commit is contained in:
linfaxin 2015-03-22 11:14:54 +08:00
parent b460d4dd47
commit 79bb4ecb36
3 changed files with 300 additions and 453 deletions

View File

@ -29,9 +29,9 @@ public class MyActivity extends Activity {
sample1 = (SwipeLayout) findViewById(R.id.sample1); sample1 = (SwipeLayout) findViewById(R.id.sample1);
sample1.setShowMode(SwipeLayout.ShowMode.PullOut); 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) // 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() { sample1.addRevealListener(R.id.delete, new SwipeLayout.OnRevealListener() {
@Override @Override
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) { public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {

View File

@ -5,28 +5,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/bird_left" android:layout_gravity="left|right|top"
android:layout_gravity="left"
android:src="@drawable/bird" android:src="@drawable/bird"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="match_parent" /> android:layout_height="100dp" />
<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>
<LinearLayout <LinearLayout
android:id="@+id/bird_bottom" android:id="@+id/bird_bottom"
android:layout_gravity="bottom" android:layout_gravity="bottom"

File diff suppressed because it is too large Load Diff