Guest User

Untitled

a guest
Jan 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. if (linearLayout.getVisibility() == View.INVISIBLE) {
  2. linearLayout.animate()
  3. .translationY(0)
  4. .alpha(1.0f)
  5. .setDuration(400)
  6. .setListener(new AnimatorListenerAdapter() {
  7. @Override
  8. public void onAnimationEnd(Animator animation) {
  9. super.onAnimationEnd(animation);
  10. linearLayout.setVisibility(View.VISIBLE);
  11. linearLayout.clearAnimation();
  12. layoutManager.scrollToPosition(position);
  13. }
  14. });
  15.  
  16. }
  17. else{
  18. linearLayout.animate()
  19. .translationY(view.getHeight())
  20. .alpha(0.0f)
  21. .setDuration(400)
  22. .setListener(new AnimatorListenerAdapter() {
  23. @Override
  24. public void onAnimationEnd(Animator animation) {
  25. super.onAnimationEnd(animation);
  26. linearLayout.clearAnimation();
  27. linearLayout.setVisibility(View.INVISIBLE);
  28. }
  29. });
  30.  
  31. }
Add Comment
Please, Sign In to add comment