title: Android Floating Action Button animation
body: <p>All I want is a simple animation, when the scrollview moves. I have tried some solution, but none of them worked perfectly/smoothly.If I scroll, I want to hide the fab with slide down animation and if nothing happens after 2 sec the fab shows with slide up animation. I know it is a basic question and I appreciate your patientence.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>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;
    }
  });
  </code></pre>