Ejemplo n.º 1
0
  public void setMenuVisibility(final boolean show, final boolean force) {
    if (!force && mShowMenu == show) return;

    mShowMenu = show;

    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_CONDITIONAL_MENU, mShowMenu ? View.VISIBLE : View.INVISIBLE);
  }
Ejemplo n.º 2
0
  public void setDisabledFlags(int disabledFlags, boolean force) {
    if (!force && mDisabledFlags == disabledFlags) return;

    mDisabledFlags = disabledFlags;

    final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0);
    final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
    final boolean disableBack =
        ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0)
            && ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
    final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0);

    if (SLIPPERY_WHEN_DISABLED) {
      setSlippery(disableHome && disableRecent && disableBack && disableSearch);
    }

    if (!mScreenOn && mCurrentView != null) {
      ViewGroup navButtons = (ViewGroup) mCurrentView.findViewById(R.id.nav_buttons);
      LayoutTransition lt = navButtons == null ? null : navButtons.getLayoutTransition();
      if (lt != null) {
        lt.disableTransitionType(
            LayoutTransition.CHANGE_APPEARING
                | LayoutTransition.CHANGE_DISAPPEARING
                | LayoutTransition.APPEARING
                | LayoutTransition.DISAPPEARING);
      }
    }

    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_BACK, disableBack ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_HOME, disableHome ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_RECENT, disableRecent ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_RECENT, disableRecent ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_ALWAYS_MENU, disableRecent ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_MENU_BIG, disableRecent ? View.INVISIBLE : View.VISIBLE);
    setButtonWithTagVisibility(
        NavbarEditor.NAVBAR_SEARCH, disableRecent ? View.INVISIBLE : View.VISIBLE);
    getSearchLight().setVisibility((disableHome && !disableSearch) ? View.VISIBLE : View.GONE);
  }