public void reorient() {
    int rot = mContext.getResources().getConfiguration().orientation;
    for (int i = 1; i < 3; i++) {
      mRotatedViews[i].setVisibility(View.GONE);
    }
    mCurrentView = mRotatedViews[rot];
    mCurrentView.setVisibility(View.VISIBLE);
    if (NavbarEditor.isDevicePhone(mContext)) {
      rot = mDisplay.getRotation();
      mVertical = (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270);
    } else {
      mVertical = getWidth() > 0 && getHeight() > getWidth();
    }
    mEditBar = new NavbarEditor((ViewGroup) mCurrentView.findViewById(R.id.container), mVertical);
    mEditBar.updateKeys();
    mEditBar.updateLowLights(mCurrentView);
    toggleButtonListener(true);

    mDeadZone = (DeadZone) mCurrentView.findViewById(R.id.deadzone);

    // force the low profile & disabled states into compliance
    setLowProfile(mLowProfile, false, true /* force */);
    setDisabledFlags(mDisabledFlags, true /* force */);
    setMenuVisibility(mShowMenu, true /* force */);

    if (DEBUG) {
      Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
    }

    setNavigationIconHints(mNavigationIconHints, true);
  }
Пример #2
0
  public void setHidden(final boolean hide) {
    if (hide == mHidden) return;

    mHidden = hide;
    Slog.d(TAG, (hide ? "HIDING" : "SHOWING") + " navigation bar");

    // bring up the lights no matter what
    setLowProfile(false);
  }
Пример #3
0
        @Override
        public boolean onTouch(View v, MotionEvent ev) {
          if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            // even though setting the systemUI visibility below will turn these views
            // on, we need them to come up faster so that they can catch this motion
            // event
            setLowProfile(false, false, false);

            try {
              mBarService.setSystemUiVisibility(0, View.SYSTEM_UI_FLAG_LOW_PROFILE);
            } catch (android.os.RemoteException ex) {
            }
          }
          return false;
        }
Пример #4
0
  public void reorient() {
    final int rot = mDisplay.getRotation();
    for (int i = 0; i < 4; i++) {
      mRotatedViews[i].setVisibility(View.GONE);
    }
    mCurrentView = mRotatedViews[rot];
    mCurrentView.setVisibility(View.VISIBLE);

    mDeadZone = (DeadZone) mCurrentView.findViewById(R.id.deadzone);

    // force the low profile & disabled states into compliance
    setLowProfile(mLowProfile, false, true /* force */);
    setDisabledFlags(mDisabledFlags, true /* force */);
    setMenuVisibility(mShowMenu, true /* force */);

    if (DEBUG) {
      Slog.d(TAG, "reorient(): rot=" + mDisplay.getRotation());
    }

    setNavigationIconHints(mNavigationIconHints, true);
  }
Пример #5
0
 public void setLowProfile(final boolean lightsOut) {
   setLowProfile(lightsOut, true, false);
 }