/** * @return Current visibility or if animating, the visibility being animated to. */ public int getAnimatedVisibility() { if (mVisibilityAnim != null) { return mVisAnimListener.mFinalVisibility; } return getVisibility(); }
public void postShowOverflowMenu() { post(new Runnable() { public void run() { showOverflowMenu(); } }); }
public void setContentHeight(int height) { mContentHeight = height; requestLayout(); }
@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); } }
if (getVisibility() != VISIBLE) { setAlpha(0); if (mSplitView != null && mMenuView != null) { mMenuView.setAlpha(0);
@Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mActionMenuPresenter != null) { mActionMenuPresenter.hideOverflowMenu(); mActionMenuPresenter.hideSubMenus(); } }
@Override public Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); SavedState state = new SavedState(superState); if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) { state.expandedMenuItemId = mExpandedMenuPresenter.mCurrentExpandedItem.getItemId(); } state.isOverflowOpen = isOverflowMenuShowing(); return state; }
@Override protected void onFinishInflate() { super.onFinishInflate(); addView(mHomeLayout); if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { final ViewParent parent = mCustomNavView.getParent(); if (parent != this) { if (parent instanceof ViewGroup) { ((ViewGroup) parent).removeView(mCustomNavView); } addView(mCustomNavView); } } }
@Override public void onRestoreInstanceState(Parcelable p) { SavedState state = (SavedState) p; super.onRestoreInstanceState(state.getSuperState()); if (state.expandedMenuItemId != 0 && mExpandedMenuPresenter != null && mOptionsMenu != null) { final MenuItem item = mOptionsMenu.findItem(state.expandedMenuItemId); if (item != null) { item.expandActionView(); } } if (state.isOverflowOpen) { postShowOverflowMenu(); } }
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mTitleView = null; mSubtitleView = null; mTitleUpView = null; if (mTitleLayout != null && mTitleLayout.getParent() == this) { removeView(mTitleLayout); } mTitleLayout = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { initTitle(); } if (mTabScrollView != null && mIncludeTabs) { ViewGroup.LayoutParams lp = mTabScrollView.getLayoutParams(); if (lp != null) { lp.width = LayoutParams.WRAP_CONTENT; lp.height = LayoutParams.MATCH_PARENT; } mTabScrollView.setAllowCollapse(true); } }
@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); } }
if (getVisibility() != VISIBLE) { setAlpha(0); if (mSplitView != null && mMenuView != null) { mMenuView.setAlpha(0);
@Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); //UNUSED removeCallbacks(mTabSelector); if (mActionMenuPresenter != null) { mActionMenuPresenter.hideOverflowMenu(); mActionMenuPresenter.hideSubMenus(); } }
@Override public Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); SavedState state = new SavedState(superState); if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) { state.expandedMenuItemId = mExpandedMenuPresenter.mCurrentExpandedItem.getItemId(); } state.isOverflowOpen = isOverflowMenuShowing(); return state; }
@Override protected void onFinishInflate() { super.onFinishInflate(); addView(mHomeLayout); if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { final ViewParent parent = mCustomNavView.getParent(); if (parent != this) { if (parent instanceof ViewGroup) { ((ViewGroup) parent).removeView(mCustomNavView); } addView(mCustomNavView); } } }
@Override public void onRestoreInstanceState(Parcelable p) { SavedState state = (SavedState) p; super.onRestoreInstanceState(state.getSuperState()); if (state.expandedMenuItemId != 0 && mExpandedMenuPresenter != null && mOptionsMenu != null) { final MenuItem item = mOptionsMenu.findItem(state.expandedMenuItemId); if (item != null) { item.expandActionView(); } } if (state.isOverflowOpen) { postShowOverflowMenu(); } }
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mTitleView = null; mSubtitleView = null; mTitleUpView = null; if (mTitleLayout != null && mTitleLayout.getParent() == this) { removeView(mTitleLayout); } mTitleLayout = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { initTitle(); } if (mTabScrollView != null && mIncludeTabs) { ViewGroup.LayoutParams lp = mTabScrollView.getLayoutParams(); if (lp != null) { lp.width = LayoutParams.WRAP_CONTENT; lp.height = LayoutParams.MATCH_PARENT; } mTabScrollView.setAllowCollapse(true); } }
@Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mActionMenuPresenter != null) { mActionMenuPresenter.hideOverflowMenu(); mActionMenuPresenter.hideSubMenus(); } }
public void postShowOverflowMenu() { post(new Runnable() { public void run() { showOverflowMenu(); } }); }
/** * @return Current visibility or if animating, the visibility being animated to. */ public int getAnimatedVisibility() { if (mVisibilityAnim != null) { return mVisAnimListener.mFinalVisibility; } return getVisibility(); }