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);
   }
 }
 public TabletStatusBarTransitions(TabletStatusBarView view, Object barService) {
   super(view, SystemR.drawable.nav_background);
   mView = view;
   mBarService = barService;
   final Resources res = mView.getContext().getResources();
   mIconAlphaWhenOpaque = res.getFraction(SystemR.dimen.status_bar_icon_drawing_alpha, 1, 1);
 }
  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);
    }
  }
  private void applyLightsOut(boolean lightsOut, boolean animate, boolean force) {
    if (!force && lightsOut == mLightsOut) return;

    mLightsOut = lightsOut;

    final View statusBar = mView.findViewById(TkR.id.bar_contents);
    final View lowLights = mView.findViewById(TkR.id.bar_shadow);

    // ok, everyone, stop it right there
    statusBar.animate().cancel();
    lowLights.animate().cancel();

    final float navButtonsAlpha = lightsOut ? 0f : 1f;
    final float lowLightsAlpha = lightsOut ? 1f : 0f;

    if (!animate) {
      statusBar.setAlpha(navButtonsAlpha);
      lowLights.setAlpha(lowLightsAlpha);
      lowLights.setVisibility(lightsOut ? View.VISIBLE : View.GONE);
    } else {
      final int duration = lightsOut ? LIGHTS_OUT_DURATION : LIGHTS_IN_DURATION;
      statusBar.animate().alpha(navButtonsAlpha).setDuration(duration).start();

      lowLights.setOnTouchListener(mLightsOutListener);
      if (lowLights.getVisibility() == View.GONE) {
        lowLights.setAlpha(0f);
        lowLights.setVisibility(View.VISIBLE);
      }
      lowLights
          .animate()
          .alpha(lowLightsAlpha)
          .setDuration(duration)
          .setInterpolator(new AccelerateInterpolator(2.0f))
          .setListener(
              lightsOut
                  ? null
                  : new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator _a) {
                      lowLights.setVisibility(View.GONE);
                    }
                  })
          .start();
    }
  }
 public void init() {
   mFeedbackIconArea = mView.findViewById(TkR.id.feedbackIconArea);
   mStatusIcons = mView.findViewById(SystemR.id.statusIcons);
   mSignalCluster = mView.findViewById(SystemR.id.signal_cluster);
   mBattery = mView.findViewById(SystemR.id.battery);
   mBatteryText = mView.findViewById(TkR.id.battery_text);
   mBluetooth = mView.findViewById(TkR.id.bluetooth);
   mClock = mView.findViewById(SystemR.id.clock);
   applyModeBackground(-1, getMode(), false /*animate*/);
   applyMode(getMode(), false /*animate*/, true /*force*/);
 }
 @Override
 public void setContentVisible(boolean visible) {
   final float alpha = visible ? 1 : 0;
   //        fadeContent(mView.getCameraButton(), alpha);
   fadeContent(mView.getSearchLight(), alpha);
 }