Ejemplo n.º 1
0
  public void showUndoBar(boolean immediate, CharSequence message, Parcelable undoToken) {
    mUndoToken = undoToken;
    mUndoMessage = message;
    mMessageView.setText(mUndoMessage);

    //        mHideHandler.removeCallbacks(mHideRunnable);
    //        mHideHandler.postDelayed(mHideRunnable,
    //                mBarView.getResources().getInteger(R.integer.undobar_hide_delay));

    mBarView.setVisibility(View.VISIBLE);
    if (immediate) {
      //            mBarView.setAlpha(1);
      AlphaManager.setAlpha(mBarView, 1);
    } else {
      mBarAnimator.cancel();
      mBarAnimator
          .alpha(1)
          .setDuration(mBarView.getResources().getInteger(android.R.integer.config_shortAnimTime))
          .setListener(null);
    }
  }
Ejemplo n.º 2
0
  public void hideUndoBar(boolean immediate) {
    //        mHideHandler.removeCallbacks(mHideRunnable);
    if (immediate) {
      mBarView.setVisibility(View.GONE);
      AlphaManager.setAlpha(mBarView, 0);
      mUndoMessage = null;
      mUndoToken = null;

    } else {
      mBarAnimator.cancel();
      mBarAnimator
          .alpha(0)
          .setDuration(mBarView.getResources().getInteger(android.R.integer.config_shortAnimTime))
          .setListener(
              new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                  mBarView.setVisibility(View.GONE);
                  mUndoMessage = null;
                  mUndoToken = null;
                }
              });
    }
  }