private void showAnim() {
   int y = getIntent().getIntExtra("y", 0);
   int[] loc = new int[2];
   layout_task.getLocationOnScreen(loc);
   L.d("y:" + y + "," + loc[1]);
   layout_task.setVisibility(View.VISIBLE);
   layout_task.setTranslationY(y - loc[1]);
   layout_task.animate().translationY(0).setDuration(400).start();
   iv_sort.animate().alpha(0).setDuration(400).start();
   iv_search.animate().alpha(0).setDuration(400).start();
   iv_home_bg.animate().alpha(1).setDuration(400).start();
   title_bg.animate().alpha(0).setDuration(400).start();
   ll_bottom.animate().alpha(1).setDuration(400).start();
   materialMenu.animateState(MaterialMenuDrawable.IconState.ARROW);
   String path = task.getAudioUrl();
   if (path != null) {
     ll_audio.animate().alpha(1).setDuration(300).start();
   }
 }
  private void hideViews() {
    mToolbar
        .animate()
        .translationY(-mToolbar.getHeight())
        .setInterpolator(new AccelerateInterpolator(2));

    FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mFabButton.getLayoutParams();
    int fabBottomMargin = lp.bottomMargin;
    mFabButton
        .animate()
        .translationY(mFabButton.getHeight() + fabBottomMargin)
        .setInterpolator(new AccelerateInterpolator(2))
        .start();
  }
Example #3
0
 public void showDeleteSnackbar(AppCompatActivity activity, int count, final int rowHeight) {
   new Snackbar()
       .setText(getResources().getQuantityString(R.plurals.info_deleted, count, count))
       .setActionText(getString(R.string.undo))
       .setActionListener(
           new Snackbar.OnActionListener() {
             @Override
             public void onAction() {
               int firstVisiblePos = mListView.getFirstVisiblePosition();
               int end = mRemoveCount - 1;
               View v;
               for (int i = end; i >= 0; --i) {
                 v = mListView.getChildAt(mToBeRemoved[i] - firstVisiblePos);
                 if (v != null) {
                   mAdapter.undoDelete(v, rowHeight);
                 }
               }
               mAdapter.markDeletion(mToBeRemoved, mRemoveCount, false);
               mRemoveCount = 0;
             }
           })
       .setDismissListener(
           new DialogInterface.OnDismissListener() {
             @Override
             public void onDismiss(DialogInterface dialog) {
               if (mFabToPush > 0) {
                 mFab.animate().yBy(mFabToPush);
               }
               if (mRemoveCount > 0) {
                 mAdapter.doDelete(mToBeRemoved, mRemoveCount);
                 mListener.onDeleted(mCategoryId, mRemoveCount);
                 mRemoveCount = 0;
               }
             }
           })
       .show(activity);
   if (mFabToPush > 0) {
     mFab.animate().yBy(-mFabToPush);
   }
 }
 private void showViews() {
   mToolbar.animate().translationY(0).setInterpolator(new DecelerateInterpolator(2));
   mFabButton.animate().translationY(0).setInterpolator(new DecelerateInterpolator(2)).start();
 }