Here you can find the source of getActionBarSize(Context context)
Parameter | Description |
---|---|
context | the android.content.Context used to retrieve the theme. |
public static int getActionBarSize(Context context)
//package com.java2s; import android.content.Context; import android.content.res.TypedArray; public class Main { /**//from w w w .j a v a 2 s. c o m * Get the action bar size in pixel. * * @param context the {@link android.content.Context} used to retrieve the theme. * @return */ public static int getActionBarSize(Context context) { final TypedArray styledAttributes = context.getTheme() .obtainStyledAttributes( new int[] { android.R.attr.actionBarSize }); final int actionBarSize = (int) styledAttributes.getDimension(0, 0); styledAttributes.recycle(); return actionBarSize; } }