Ejemplo n.º 1
0
  public void stopAnim() {
    if (valueAnimator != null) {
      clearAnimation();

      valueAnimator.setRepeatCount(0);
      valueAnimator.cancel();
      valueAnimator.end();
      mAnimatedValue = 0.9f;
      postInvalidate();
    }
  }
Ejemplo n.º 2
0
  private void handleComposeButtonClick() {
    switch (mButtonState) {
      case ATTACH:
        mAttachmentPanel.setVisibility(VISIBLE);
        updateButtonState();
        break;

      case SEND:
        // If the API version is less than KitKat, they can send an SMS; so do this.
        if (Build.VERSION.SDK_INT < 19) {
          if (mDelayedMessagingEnabled) {
            sendDelayedSms();
          } else {
            sendSms();
          }
        } else {
          // Otherwise... check if we're not the default SMS app
          boolean isDefaultSmsApp = Utils.isDefaultSmsApp(mContext);

          // Now make sure that a client hasn't blocked sending, i.e. in the welcome
          // screen when we have a demo conversation.
          if (mIsSendingBlocked) {
            // Show the sending blocked message (if it exists)
            Toast.makeText(mContext, mSendingBlockedMessage, Toast.LENGTH_SHORT).show();

          } else if (!isDefaultSmsApp) {
            // Ask to become the default SMS app
            new DefaultSmsHelper(mContext, R.string.not_default_send).showIfNotDefault(this);

          } else if (!TextUtils.isEmpty(mReplyText.getText()) || mAttachment.hasAttachment()) {
            if (mDelayedMessagingEnabled) {
              sendDelayedSms();
            } else {
              sendSms();
            }
          }
        }
        break;

      case CLOSE:
        mAttachmentPanel.setVisibility(GONE);
        updateButtonState();
        break;

      case CANCEL:
        mSendingCancelled = true;
        mProgressAnimator.end();
        // updateButtonState();
        break;
    }
  }
 public void stop() {
   if (mAnimator != null) {
     mAnimator.end();
   }
 }
 public void end() {
   mAnimator.end();
   mDirection = STOPPED;
 }
Ejemplo n.º 5
0
 /** 涟漪关闭 */
 public void rippleStop() {
   if (valueRadiusAnimator != null) {
     valueRadiusAnimator.end();
   }
 }
Ejemplo n.º 6
0
 /**
  * If there's a pending delayed message, end the progress animation and go ahead with sending the
  * message
  */
 private void sendPendingDelayedMessage() {
   if (mButtonState == SendButtonState.CANCEL && mProgressAnimator != null) {
     mProgressAnimator.end();
   }
 }