コード例 #1
0
 protected void onClear() {
   if (TextUtils.isEmpty(mFormulaEditText.getCleanText())) {
     return;
   }
   reveal(
       mCurrentButton,
       R.color.calculator_accent_color,
       new AnimationFinishedListener() {
         @Override
         public void onAnimationFinished() {
           mFormulaEditText.clear();
           incrementGroupId();
         }
       });
 }
コード例 #2
0
  protected void onError(final int errorResourceId) {
    if (mCurrentState != CalculatorState.EVALUATE) {
      // Only animate error on evaluate.
      mResultEditText.setText(errorResourceId);
      return;
    }

    reveal(
        mCurrentButton,
        R.color.calculator_error_color,
        new AnimationFinishedListener() {
          @Override
          public void onAnimationFinished() {
            setState(CalculatorState.ERROR);
            mResultEditText.setText(errorResourceId);
          }
        });
  }