我只需要一个简单的动画,当滚动视图移动时。我尝试了一些解决方案,但没有一个完美/流畅地工作。如果我滚动,我想用向下滑动的动画隐藏fab,如果2秒后什么也没发生,fab就会用向上滑动的动画显示出来。我知道这是一个基本的问题,感谢您的耐心。
提前致谢。
提前致谢。
final ScrollView scroll = (ScrollView) v.findViewById(R.id.sw);
scroll.setOnTouchListener(new View.OnTouchListener()){
@Override
public boolean onTouch(View v, Motionevent event){
int action = event.getAction();
if (action == Motionevent.ACTION_MOVE){
//slide down animation here
}else{
new Handler().postDelayed(new Runnable(){
public void run(){
//slide up animation here
}
}, 2000);
}
return false;
}
});