Exemplo n.º 1
0
 public void onConfigurationChanged(Configuration paramConfiguration) {
   if (Build.VERSION.SDK_INT >= 8) super.onConfigurationChanged(paramConfiguration);
   while (true) {
     TypedArray localTypedArray =
         getContext()
             .obtainStyledAttributes(
                 null, R.styleable.SherlockActionBar, R.attr.actionBarStyle, 0);
     setContentHeight(localTypedArray.getLayoutDimension(4, 0));
     localTypedArray.recycle();
     if (this.mSplitWhenNarrow)
       setSplitActionBar(
           ResourcesCompat.getResources_getBoolean(
               getContext(), R.bool.abs__split_action_bar_is_narrow));
     if (this.mActionMenuPresenter != null)
       this.mActionMenuPresenter.onConfigurationChanged(paramConfiguration);
     return;
     if (this.mMenuView == null) continue;
     this.mMenuView.onConfigurationChanged(paramConfiguration);
   }
 }
Exemplo n.º 2
0
  /*
   * Must be public so we can dispatch pre-2.2 via ActionBarImpl.
   */
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
      super.onConfigurationChanged(newConfig);
    } else if (mMenuView != null) {
      mMenuView.onConfigurationChanged(newConfig);
    }

    // Action bar can change size on configuration changes.
    // Reread the desired height from the theme-specified style.
    TypedArray a =
        getContext()
            .obtainStyledAttributes(null, R.styleable.SherlockActionBar, R.attr.actionBarStyle, 0);
    setContentHeight(a.getLayoutDimension(R.styleable.SherlockActionBar_height, 0));
    a.recycle();
    if (mSplitWhenNarrow) {
      setSplitActionBar(
          getResources_getBoolean(getContext(), R.bool.abs__split_action_bar_is_narrow));
    }
    if (mActionMenuPresenter != null) {
      mActionMenuPresenter.onConfigurationChanged(newConfig);
    }
  }