Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (linearLayout.getVisibility() == View.INVISIBLE) {
- linearLayout.animate()
- .translationY(0)
- .alpha(1.0f)
- .setDuration(400)
- .setListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- linearLayout.setVisibility(View.VISIBLE);
- linearLayout.clearAnimation();
- layoutManager.scrollToPosition(position);
- }
- });
- }
- else{
- linearLayout.animate()
- .translationY(view.getHeight())
- .alpha(0.0f)
- .setDuration(400)
- .setListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- linearLayout.clearAnimation();
- linearLayout.setVisibility(View.INVISIBLE);
- }
- });
- }
Add Comment
Please, Sign In to add comment