Search in sources :

Example 21 with TintTypedArray

use of android.support.v7.widget.TintTypedArray in project Android-skin-support by ximsfei.

the class SkinMaterialTextInputLayout method loadCounterTextColorResFromAttributes.

private void loadCounterTextColorResFromAttributes(@StyleRes int resId) {
    if (resId != INVALID_ID) {
        TintTypedArray counterTA = TintTypedArray.obtainStyledAttributes(getContext(), resId, skin.support.R.styleable.SkinTextAppearance);
        if (counterTA.hasValue(skin.support.R.styleable.SkinTextAppearance_android_textColor)) {
            mCounterTextColorResId = counterTA.getResourceId(skin.support.R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
            SkinLog.d(TAG, "mCounterTextColorResId name = " + getResources().getResourceName(mCounterTextColorResId));
        }
        counterTA.recycle();
    }
    applyCounterTextColorResource();
}
Also used : TintTypedArray(android.support.v7.widget.TintTypedArray)

Example 22 with TintTypedArray

use of android.support.v7.widget.TintTypedArray in project Android-skin-support by ximsfei.

the class SkinCompatBackgroundHelper method loadFromAttributes.

public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs, R.styleable.SkinBackgroundHelper, defStyleAttr, 0);
    try {
        if (a.hasValue(R.styleable.SkinBackgroundHelper_android_background)) {
            mBackgroundResId = a.getResourceId(R.styleable.SkinBackgroundHelper_android_background, INVALID_ID);
        }
    } finally {
        a.recycle();
    }
    applySkin();
}
Also used : TintTypedArray(android.support.v7.widget.TintTypedArray)

Example 23 with TintTypedArray

use of android.support.v7.widget.TintTypedArray in project Android-skin-support by ximsfei.

the class SkinCompatImageHelper method loadFromAttributes.

public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TintTypedArray a = null;
    try {
        a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs, R.styleable.SkinCompatImageView, defStyleAttr, 0);
        mSrcResId = a.getResourceId(R.styleable.SkinCompatImageView_android_src, INVALID_ID);
    } finally {
        if (a != null) {
            a.recycle();
        }
    }
    applySkin();
}
Also used : TintTypedArray(android.support.v7.widget.TintTypedArray)

Example 24 with TintTypedArray

use of android.support.v7.widget.TintTypedArray in project Android-skin-support by ximsfei.

the class SkinCompatProgressBarHelper method loadFromAttributes.

void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs, TINT_ATTRS, defStyleAttr, 0);
    mIndeterminateDrawableResId = a.getResourceId(0, INVALID_ID);
    mProgressDrawableResId = a.getResourceId(1, INVALID_ID);
    a.recycle();
    applySkin();
}
Also used : TintTypedArray(android.support.v7.widget.TintTypedArray)

Example 25 with TintTypedArray

use of android.support.v7.widget.TintTypedArray in project Shuttle by timusus.

the class CustomCollapsingTextHelper method setExpandedTextAppearance.

public void setExpandedTextAppearance(int resId) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
        mExpandedTitleColor = a.getColorStateList(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
    }
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
        mExpandedTextSize = a.getDimensionPixelSize(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize, (int) mExpandedTextSize);
    }
    mExpandedShadowColor = a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
    mExpandedShadowDx = a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
    mExpandedShadowDy = a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
    mExpandedShadowRadius = a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
    a.recycle();
    if (Build.VERSION.SDK_INT >= 16) {
        mExpandedTypeface = readFontFamilyTypeface(resId);
    }
    recalculate();
}
Also used : TintTypedArray(android.support.v7.widget.TintTypedArray)

Aggregations

TintTypedArray (android.support.v7.widget.TintTypedArray)24 Context (android.content.Context)3 SuppressLint (android.annotation.SuppressLint)2 Paint (android.graphics.Paint)2 Drawable (android.graphics.drawable.Drawable)2 TextPaint (android.text.TextPaint)2 ColorStateList (android.content.res.ColorStateList)1 AllCapsTransformationMethod (android.support.v7.text.AllCapsTransformationMethod)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 Point (com.reactnativenavigation.views.utils.Point)1