@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_animation);
ImageView view = new ImageView(this);
view.setBackgroundResource(R.drawable.custom_button_selector);
view.setScaleType(ImageView.ScaleType.CENTER);
mReachability = new Reachability(this);
mReachability.canTouchableBackView(true);
mReachability.setBackImageResource(R.drawable.tiles);
// Should call before makeHoverView!
mReachability.setHoverView(view, android.R.drawable.ic_partial_secure, android.R.drawable.ic_secure);
mReachability.makeHoverView(Reachability.Position.CENTER);
mReachability.setCustomSlideInAnimation(1000, new AnticipateOvershootInterpolator(), fromLeftAnimation());
mReachability.setCustomSlideOutAnimation(1000, new AnticipateOvershootInterpolator(), toRightAnimation());
findViewById(R.id.switch_hover).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mReachability.switchHover();
}
});
}
CustomAnimationActivity.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:Reachability
作者:
评论列表
文章目录