Methods Summary |
---|
public void | animateToVisibility(int visibility)
if (mVisibilityAnim != null) {
mVisibilityAnim.cancel();
}
if (visibility == VISIBLE) {
if (getVisibility() != VISIBLE) {
ViewCompat.setAlpha(this, 0f);
if (mSplitView != null && mMenuView != null) {
ViewCompat.setAlpha(mMenuView, 0f);
}
}
ViewPropertyAnimatorCompat anim = ViewCompat.animate(this).alpha(1f);
anim.setDuration(FADE_DURATION);
anim.setInterpolator(sAlphaInterpolator);
if (mSplitView != null && mMenuView != null) {
ViewPropertyAnimatorCompatSet set = new ViewPropertyAnimatorCompatSet();
ViewPropertyAnimatorCompat splitAnim = ViewCompat.animate(mMenuView).alpha(1f);
splitAnim.setDuration(FADE_DURATION);
set.setListener(mVisAnimListener.withFinalVisibility(anim, visibility));
set.play(anim).play(splitAnim);
set.start();
} else {
anim.setListener(mVisAnimListener.withFinalVisibility(anim, visibility));
anim.start();
}
} else {
ViewPropertyAnimatorCompat anim = ViewCompat.animate(this).alpha(0f);
anim.setDuration(FADE_DURATION);
anim.setInterpolator(sAlphaInterpolator);
if (mSplitView != null && mMenuView != null) {
ViewPropertyAnimatorCompatSet set = new ViewPropertyAnimatorCompatSet();
ViewPropertyAnimatorCompat splitAnim = ViewCompat.animate(mMenuView).alpha(0f);
splitAnim.setDuration(FADE_DURATION);
set.setListener(mVisAnimListener.withFinalVisibility(anim, visibility));
set.play(anim).play(splitAnim);
set.start();
} else {
anim.setListener(mVisAnimListener.withFinalVisibility(anim, visibility));
anim.start();
}
}
|
public boolean | canShowOverflowMenu()
return isOverflowReserved() && getVisibility() == VISIBLE;
|
public void | dismissPopupMenus()
if (mActionMenuPresenter != null) {
mActionMenuPresenter.dismissPopupMenus();
}
|
public int | getAnimatedVisibility()
if (mVisibilityAnim != null) {
return mVisAnimListener.mFinalVisibility;
}
return getVisibility();
|
public int | getContentHeight()
return mContentHeight;
|
public boolean | hideOverflowMenu()
if (mActionMenuPresenter != null) {
return mActionMenuPresenter.hideOverflowMenu();
}
return false;
|
public boolean | isOverflowMenuShowPending()
if (mActionMenuPresenter != null) {
return mActionMenuPresenter.isOverflowMenuShowPending();
}
return false;
|
public boolean | isOverflowMenuShowing()
if (mActionMenuPresenter != null) {
return mActionMenuPresenter.isOverflowMenuShowing();
}
return false;
|
public boolean | isOverflowReserved()
return mActionMenuPresenter != null && mActionMenuPresenter.isOverflowReserved();
|
protected int | measureChildView(android.view.View child, int availableWidth, int childSpecHeight, int spacing)
child.measure(MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
childSpecHeight);
availableWidth -= child.getMeasuredWidth();
availableWidth -= spacing;
return Math.max(0, availableWidth);
|
protected static int | next(int x, int val, boolean isRtl)
return isRtl ? x - val : x + val;
|
protected void | onConfigurationChanged(android.content.res.Configuration newConfig)
if (Build.VERSION.SDK_INT >= 8) {
super.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.ActionBar,
R.attr.actionBarStyle, 0);
setContentHeight(a.getLayoutDimension(R.styleable.ActionBar_height, 0));
a.recycle();
if (mActionMenuPresenter != null) {
mActionMenuPresenter.onConfigurationChanged(newConfig);
}
|
protected int | positionChild(android.view.View child, int x, int y, int contentHeight, boolean reverse)
int childWidth = child.getMeasuredWidth();
int childHeight = child.getMeasuredHeight();
int childTop = y + (contentHeight - childHeight) / 2;
if (reverse) {
child.layout(x - childWidth, childTop, x, childTop + childHeight);
} else {
child.layout(x, childTop, x + childWidth, childTop + childHeight);
}
return (reverse ? -childWidth : childWidth);
|
public void | postShowOverflowMenu()
post(new Runnable() {
public void run() {
showOverflowMenu();
}
});
|
public void | setContentHeight(int height)
mContentHeight = height;
requestLayout();
|
public void | setSplitToolbar(boolean split)Sets whether the bar should be split right now, no questions asked.
mSplitActionBar = split;
|
public void | setSplitView(android.view.ViewGroup splitView)
mSplitView = splitView;
|
public void | setSplitWhenNarrow(boolean splitWhenNarrow)Sets whether the bar should split if we enter a narrow screen configuration.
mSplitWhenNarrow = splitWhenNarrow;
|
public boolean | showOverflowMenu()
if (mActionMenuPresenter != null) {
return mActionMenuPresenter.showOverflowMenu();
}
return false;
|