Code example for TypedValue

Methods: resolveAttribute

0
 
    protected Drawable getActionBarBackground(Context context) {
        int[] android_styleable_ActionBar = { android.R.attr.background };
 
        // Need to get resource id of style pointed to from actionBarStyle 
        TypedValue outValue = new TypedValue();
        context.getTheme().resolveAttribute(android.R.attr.actionBarStyle, outValue, true);
        // Now get action bar style values... 
        TypedArray abStyle = context.getTheme().obtainStyledAttributes(outValue.resourceId,
                android_styleable_ActionBar);
        try { 
            // background is the first attr in the array above so it's index is 0. 
            return abStyle.getDrawable(0);
        } finally { 
            abStyle.recycle();
        } 
    } 
 
    protected int getActionBarSize(Context context) {
        int[] attrs = { android.R.attr.actionBarSize };
Experience pair programming with AI  Get Codota for Java