List of usage examples for android.view.animation AnimationUtils loadLayoutAnimation
public static LayoutAnimationController loadLayoutAnimation(Context context, @AnimRes int id) throws NotFoundException
From source file:com.example.android.home.Home.java
/** * Hides all of the applications by playing an animation on the grid. *//*from w w w. j ava 2 s . co m*/ private void hideApplications() { if (mBlockAnimation) { return; } mBlockAnimation = true; mShowApplicationsCheck.toggle(); if (mHideLayoutAnimation == null) { mHideLayoutAnimation = AnimationUtils.loadLayoutAnimation(this, R.anim.hide_applications); } mGridExit.setAnimationListener(new HideGrid()); mGrid.startAnimation(mGridExit); mGrid.setVisibility(View.INVISIBLE); // mShowApplications.requestFocus(); // This enables a layout animation; if you uncomment this code, you need to // comment the line mGrid.startAnimation() above // mGrid.setLayoutAnimationListener(new HideGrid()); // mGrid.setLayoutAnimation(mHideLayoutAnimation); // mGrid.startLayoutAnimation(); }