if(!flag){ //滑动上去
scrollLL.animate().translationY(0).translationY(-topLL.getHeight()).setDuration(400).setListener(new AnimatorListenerAdapter(){
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
btnClose.setText("展示信息");
setTopImg(btnClose,2);
}
}).start();
topLL.animate().translationY(0).translationY(-topLL.getHeight()).setDuration(400).start();
}else{ //滑动下来
topLL.animate().translationY(-topLL.getHeight()).translationY(0).setDuration(400).start();
scrollLL.animate().translationY(-topLL.getHeight()).translationY(0).setDuration(400).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
btnClose.setText("隐藏信息");
setTopImg(btnClose,1);
}
}).start();
}
网友评论