prettify the samples.

This commit is contained in:
daimajia 2015-02-22 12:07:31 +08:00
parent 19079c76cb
commit 9ca31ac50f
2 changed files with 12 additions and 1 deletions

View File

@ -59,6 +59,17 @@ public class MyActivity extends Activity {
}
});
sample1.addRevealListener(R.id.starbott, new SwipeLayout.OnRevealListener() {
@Override
public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
View star = child.findViewById(R.id.star);
float d = child.getHeight() / 2 - star.getHeight() / 2;
ViewHelper.setTranslationY(star, d * fraction);
ViewHelper.setScaleX(star, fraction + 0.6f);
ViewHelper.setScaleY(star, fraction + 0.6f);
}
});
//sample2
sample2 = (SwipeLayout) findViewById(R.id.sample2);

View File

@ -74,7 +74,7 @@
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/bottom_wrapper_child1"
android:background="#BDBEC2"
android:background="#4C535B"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView