Ejemplo n.º 1
0
  public ActionBarWrapper(Activity activity) {
    mActivity = activity;
    mActionBar = activity.getActionBar();
    if (mActionBar != null) {
      mActionBar.addOnMenuVisibilityListener(this);

      // Fixes issue #746
      int displayOptions = mActionBar.getDisplayOptions();
      mActionBar.setHomeButtonEnabled((displayOptions & DISPLAY_HOME_AS_UP) != 0);
    }
  }
 protected void hittingMenuButtonBrightensScreen() {
   ActionBar actionBar = getActionBar();
   if (actionBar != null) {
     actionBar.addOnMenuVisibilityListener(
         new ActionBar.OnMenuVisibilityListener() {
           @Override
           public void onMenuVisibilityChanged(boolean isVisible) {
             if (isVisible) {
               dimmer.handleDimTimer();
             }
           }
         });
   }
 }
 public void addOnMenuVisibilityListener(OnMenuVisibilityListener listener) {
   if (mActionBar != null) mActionBar.addOnMenuVisibilityListener(listener);
 }