@Override
  public void setWeekParams(HashMap<String, Integer> params, String tz) {
    super.setWeekParams(params, tz);

    if (params.containsKey(VIEW_PARAMS_ORIENTATION)) {
      mOrientation = params.get(VIEW_PARAMS_ORIENTATION);
    }

    updateToday(tz);
    mNumCells = mNumDays + 1;

    if (params.containsKey(VIEW_PARAMS_ANIMATE_TODAY) && mHasToday) {
      synchronized (mAnimatorListener) {
        if (mTodayAnimator != null) {
          mTodayAnimator.removeAllListeners();
          mTodayAnimator.cancel();
        }
        mTodayAnimator =
            ObjectAnimator.ofInt(this, "animateTodayAlpha", Math.max(mAnimateTodayAlpha, 80), 255);
        mTodayAnimator.setDuration(150);
        mAnimatorListener.setAnimator(mTodayAnimator);
        mAnimatorListener.setFadingIn(true);
        mTodayAnimator.addListener(mAnimatorListener);
        mAnimateToday = true;
        mTodayAnimator.start();
      }
    }
  }
Ejemplo n.º 2
0
  @Override
  protected void onDestroy() {

    timerTask.cancel();
    timer.cancel();

    if (afterAnimator != null) {
      afterAnimator.cancel();
      afterAnimator.removeAllListeners();
    }

    if (beforeAnimator != null) {
      beforeAnimator.cancel();
      beforeAnimator.removeAllListeners();
    }

    super.onDestroy();
  }