title: Wait for animate().translationY(-600).setDuration(300); to finish before running the next line of code
body: <p>I wrote some code which makes a view in my app appear by sliding down, I now want to run an additional animation for it to slide back up, and then set the visibility of that view to <code>GONE</code>.
  If I try to do that with the following code it would just set the visibility to <code>GONE</code> without running the animation.</p>
  <pre><code>if (!isTopSheetVisible) {
      pageCover.setVisibility(View.VISIBLE);
      topSheet.setVisibility(View.VISIBLE);
      topSheet.setTranslationY(-600);
      topSheet.animate().translationY(0).setDuration(300);
      isTopSheetVisible = true;
  } else {
      topSheet.animate().translationY(-600).setDuration(300);
      pageCover.setVisibility(View.GONE);
      topSheet.setVisibility(View.GONE);
      isTopSheetVisible = false;
  }
  </code></pre>
  <p>I tried setting a delay using <code>Thread.sleep</code> and <code>TimeUnit.sleep</code>, and all it did was just delaying the following lines of code, the animation still would not run.</p>