コード例 #1
0
 public void applyBackButtonQuiescentAlpha(int mode, boolean animate) {
   float backAlpha = 0;
   backAlpha = maxVisibleQuiescentAlpha(backAlpha, mView.getSearchLight());
   //        backAlpha = maxVisibleQuiescentAlpha(backAlpha, mView.getCameraButton());
   backAlpha = maxVisibleQuiescentAlpha(backAlpha, mView.getHomeButton());
   backAlpha = maxVisibleQuiescentAlpha(backAlpha, mView.getRecentsButton());
   backAlpha = maxVisibleQuiescentAlpha(backAlpha, mView.getMenuButton());
   if (backAlpha > 0) {
     setKeyButtonViewQuiescentAlpha(mView.getBackButton(), backAlpha, animate);
   }
 }
コード例 #2
0
  private void applyMode(int mode, boolean animate, boolean force) {
    // apply to key buttons
    final float alpha = alphaForMode(mode);
    setKeyButtonViewQuiescentAlpha(mView.getBackButton(), alpha, animate);
    setKeyButtonViewQuiescentAlpha(mView.getHomeButton(), alpha, animate);
    setKeyButtonViewQuiescentAlpha(mView.getRecentsButton(), alpha, animate);
    setKeyButtonViewQuiescentAlpha(mView.getMenuButton(), alpha, animate);

    setKeyButtonViewQuiescentAlpha(mView.getSearchLight(), KEYGUARD_QUIESCENT_ALPHA, animate);
    //        setKeyButtonViewQuiescentAlpha(mView.getCameraButton(), KEYGUARD_QUIESCENT_ALPHA,
    // animate);

    // apply to lights out
    applyLightsOut(mode == MODE_LIGHTS_OUT, animate, force);

    if (mFeedbackIconArea == null) return; // pre-init
    float newAlpha = getIconAlphaFor(mode);
    if (mCurrentAnimation != null) {
      mCurrentAnimation.cancel();
    }
    if (animate) {
      AnimatorSet anims = new AnimatorSet();
      anims.playTogether(
          animateTransitionTo(mFeedbackIconArea, newAlpha),
          animateTransitionTo(mStatusIcons, newAlpha),
          animateTransitionTo(mSignalCluster, newAlpha),
          animateTransitionTo(mBattery, newAlpha),
          animateTransitionTo(mBatteryText, newAlpha),
          animateTransitionTo(mBluetooth, newAlpha),
          animateTransitionTo(mClock, newAlpha));
      if (mode == MODE_LIGHTS_OUT) {
        anims.setDuration(LIGHTS_OUT_DURATION);
      }
      anims.start();
      mCurrentAnimation = anims;
    } else {
      mFeedbackIconArea.setAlpha(newAlpha);
      mStatusIcons.setAlpha(newAlpha);
      mSignalCluster.setAlpha(newAlpha);
      mBattery.setAlpha(newAlpha);
      mBatteryText.setAlpha(newAlpha);
      mBluetooth.setAlpha(newAlpha);
      mClock.setAlpha(newAlpha);
    }
  }