Skip to content

Instantly share code, notes, and snippets.

@jackgris
Created October 24, 2014 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jackgris/f673013009d750735ad2 to your computer and use it in GitHub Desktop.
Save jackgris/f673013009d750735ad2 to your computer and use it in GitHub Desktop.
How get height of ActionBarCompact
// Get height action bar compat
TypedValue tv = new TypedValue();
int attr = android.support.v7.appcompat.R.attr.actionBarSize;
if (getTheme().resolveAttribute(attr, tv, true)){
int actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
Log.w("ACTIONBAR", "height - " + actionBarHeight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment