Obtains the background color of the card view, which contains the currently shown preference
fragment, when using the split screen layout, from the activity's theme.
348960
private void obtainCardViewBackgroundColor() {
        int color;

        try {
            color = ThemeUtil.getColor(this, R.attr.cardViewBackgroundColor);
        } catch (NotFoundException e) {
            color = ContextCompat.getColor(this, R.color.card_view_background_light);
        }

        setCardViewBackgroundColor(color);
    }
995003
private void obtainHeaderBackground(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                new int[]{R.attr.materialDialogHeaderBackground});
        int resourceId = typedArray.getResourceId(0, 0);

        if (resourceId != 0) {
            setHeaderBackground(resourceId);
        } else {
            setHeaderBackgroundColor(
                    ThemeUtil.getColor(getContext(), themeResourceId, R.attr.colorPrimary));
        }
    }
1091275
public boolean getShowProgressBackground() {
        Drawable drawable = getCurrentDrawable();
        if (drawable instanceof ShowBackgroundDrawable) {
            return ((ShowBackgroundDrawable) drawable).getShowBackground();
        } else {
            return false;
        }
    }
545060
public static StateListDrawable getDrawerItemBackground(int selected_color) {
        ColorDrawable clrActive = new ColorDrawable(selected_color);
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[]{android.R.attr.state_selected}, clrActive);
        return states;
    }
184628
private boolean shouldUseFullscreen() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.fullscreen_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.fullscreen_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
755685
private void obtainFullscreen(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                new int[]{R.attr.materialDialogFullscreen});
        setFullscreen(typedArray.getBoolean(0, false));
    }
60634
private void obtainItemColor(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogItemColor});
        int defaultColor = ThemeUtil
                .getColor(getContext(), themeResourceId, android.R.attr.textColorSecondary);
        setItemColor(typedArray.getColor(0, defaultColor));
    }
411473
private Paint getSliderTrackBorderColors() {
        switch (state) {

        case BACKGROUND_DISABLED:
            return getTextBorderPaint(CommonControlState.DISABLED,false);

        case BACKGROUND_ENABLED:
            return getTextBorderPaint(CommonControlState.ENABLED,false);
        }

        return null;
    }
562052
public static int getSelectableBackground(Context ctx) {
        // If we're running on Honeycomb or newer, then we can use the Theme's
        // selectableItemBackground to ensure that the View has a pressed state
        TypedValue outValue = new TypedValue();
        //it is important here to not use the android.R because this wouldn't add the latest drawable
        ctx.getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
        return outValue.resourceId;
    }
981443
private void obtainButtonBarBackground() {
        try {
            int color =
                    ThemeUtil.getColor(getActivity(), R.attr.restoreDefaultsButtonBarBackground);
            setButtonBarBackgroundColor(color);
        } catch (NotFoundException e) {
            int resourceId = ThemeUtil
                    .getResId(getActivity(), R.attr.restoreDefaultsButtonBarBackground, -1);

            if (resourceId != -1) {
                setButtonBarBackground(resourceId);
            } else {
                setButtonBarBackgroundColor(
                        ContextCompat.getColor(getActivity(), R.color.button_bar_background_light));
            }
        }
    }
169474
@Override
    public void applyDesign(Design design, int themeColor) {
        Context ctx = mInputField.getContext();

        int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small;
        int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default_margin_small;

        int padLR = ctx.getResources().getDimensionPixelSize(largePadId);
        int padTB = ctx.getResources().getDimensionPixelSize(smallPadId);

        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.setMargins(padLR, padTB, padLR, padTB);
        mInputField.setLayoutParams(params);

        if(design.isLight())
            mInputField.setTextColor(mInputField.getResources().getColor(R.color.background_material_dark));
        else
            mInputField.setTextColor(mInputField.getResources().getColor(R.color.background_material_light));

        Drawable drawable;
        if(design.isMaterial()) {
            drawable = mInputField.getResources().getDrawable(R.drawable.edittext_mtrl_alpha);
        }else{
            drawable = mInputField.getBackground();
        }

        drawable.setColorFilter(themeColor, PorterDuff.Mode.SRC_ATOP);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
            mInputField.setBackground(drawable);
        else
            mInputField.setBackgroundDrawable(drawable);

    }
253364
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
	public int getShadowColor (){
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
			return mInputView.getShadowColor();

		return 0;
	}
534700
public static Drawable getSelectableBackground(Context ctx) {
        int selectableBackgroundRes = getSelectableBackgroundRes(ctx);
        return ContextCompat.getDrawable(ctx, selectableBackgroundRes);
    }
895922
@Override
    protected int getColor(Context ctx) {
        int color;
        if (this.isEnabled()) {
            color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text);
        } else {
            color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
        }
        return color;
    }
900923
private void obtainInsetForeground(@NonNull final TypedArray typedArray) {
        int color = typedArray.getColor(R.styleable.ScrimInsetsLayout_insetDrawable, -1);

        if (color == -1) {
            Drawable drawable = typedArray.getDrawable(R.styleable.ScrimInsetsLayout_insetDrawable);

            if (drawable != null) {
                setInsetDrawable(drawable);
            } else {
                setInsetColor(ContextCompat.getColor(getContext(),
                        R.color.scrim_insets_layout_insets_drawable_default_value));
            }
        } else {
            setInsetColor(color);
        }
    }
701159
public static StateListDrawable getSelectableImageButtonBackground(int selected_color) {
		ColorDrawable selectedColor = new ColorDrawable(selected_color);
		StateListDrawable states = new StateListDrawable();
		states.addState(new int[]{android.R.attr.state_pressed}, selectedColor);
		states.addState(new int[]{android.R.attr.state_activated}, selectedColor);
		return states;
	}
931428
public Color getBackgroundColor()
    {
        if (m_colorBackground == null)
        {
            String strBackgroundColor = this.getProperty(Params.BACKGROUNDCOLOR);   // Resource file
            if ((strBackgroundColor != null) && (strBackgroundColor.length() > 0))
                m_colorBackground = BaseApplet.nameToColor(strBackgroundColor);
        }
        if (m_colorBackground == null)
            m_colorBackground = SystemColor.window;     // Default color
        return m_colorBackground;
    }