Skip to content

Commit 9ca31ac

Browse files
committed
prettify the samples.
1 parent 19079c7 commit 9ca31ac

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: demo/src/main/java/com/daimajia/swipedemo/MyActivity.java

+11
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ public void onClick(View v) {
5959
}
6060
});
6161

62+
sample1.addRevealListener(R.id.starbott, new SwipeLayout.OnRevealListener() {
63+
@Override
64+
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
65+
View star = child.findViewById(R.id.star);
66+
float d = child.getHeight() / 2 - star.getHeight() / 2;
67+
ViewHelper.setTranslationY(star, d * fraction);
68+
ViewHelper.setScaleX(star, fraction + 0.6f);
69+
ViewHelper.setScaleY(star, fraction + 0.6f);
70+
}
71+
});
72+
6273
//sample2
6374

6475
sample2 = (SwipeLayout) findViewById(R.id.sample2);

Diff for: demo/src/main/res/layout/sample1.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
android:layout_height="match_parent">
7575
<RelativeLayout
7676
android:id="@+id/bottom_wrapper_child1"
77-
android:background="#BDBEC2"
77+
android:background="#4C535B"
7878
android:layout_width="match_parent"
7979
android:layout_height="match_parent">
8080
<ImageView

0 commit comments

Comments
 (0)