Skip to content

Instantly share code, notes, and snippets.

@tophyr
Created December 4, 2013 22:10
Show Gist options
  • Select an option

  • Save tophyr/7796505 to your computer and use it in GitHub Desktop.

Select an option

Save tophyr/7796505 to your computer and use it in GitHub Desktop.
public ActionBarContainer(Context context, AttributeSet attrs) {
super(context, attrs);
setBackgroundDrawable(null);
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ActionBar);
mBackground = a.getDrawable(com.android.internal.R.styleable.ActionBar_background);
mStackedBackground = a.getDrawable(
com.android.internal.R.styleable.ActionBar_backgroundStacked);
if (getId() == com.android.internal.R.id.split_action_bar) {
mIsSplit = true;
mSplitBackground = a.getDrawable(
com.android.internal.R.styleable.ActionBar_backgroundSplit);
}
a.recycle();
setWillNotDraw(mIsSplit ? mSplitBackground == null :
mBackground == null && mStackedBackground == null);
}
public ActionBarContainer(Context context, AttributeSet attrs) {
super(context, attrs);
setBackgroundDrawable(null);
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ActionBar);
mBackground = a.getDrawable(com.android.internal.R.styleable.ActionBar_background);
mStackedBackground = a.getDrawable(
com.android.internal.R.styleable.ActionBar_backgroundStacked);
if (getId() == com.android.internal.R.id.split_action_bar) {
mIsSplit = true;
mSplitBackground = a.getDrawable(
com.android.internal.R.styleable.ActionBar_backgroundSplit);
}
a.recycle();
setWillNotDraw(mIsSplit ? mSplitBackground == null :
mBackground == null && mStackedBackground == null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment