当前位置: 首页>>代码示例>>Java>>正文


Java R类代码示例

本文整理汇总了Java中skin.support.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


R类属于skin.support包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
@Override
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    final Context context = mView.getContext();

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SkinCompatTextHelper,
            defStyleAttr, 0);
    if (a.hasValue(R.styleable.SkinCompatTextHelper_android_drawableStart)) {
        mDrawableStartResId = a.getResourceId(R.styleable.SkinCompatTextHelper_android_drawableStart, INVALID_ID);
        mDrawableStartResId = SkinCompatHelper.checkResourceId(mDrawableStartResId);
    }
    if (a.hasValue(R.styleable.SkinCompatTextHelper_android_drawableEnd)) {
        mDrawableEndResId = a.getResourceId(R.styleable.SkinCompatTextHelper_android_drawableEnd, INVALID_ID);
        mDrawableEndResId = SkinCompatHelper.checkResourceId(mDrawableEndResId);
    }
    a.recycle();
    super.loadFromAttributes(attrs, defStyleAttr);
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:18,代码来源:SkinCompatTextHelperV17.java

示例2: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TypedArray a = null;
    try {
        a = mView.getContext().obtainStyledAttributes(attrs, R.styleable.SkinCompatImageView, defStyleAttr, 0);
        mSrcResId = a.getResourceId(R.styleable.SkinCompatImageView_android_src, INVALID_ID);
        int srcCompatResId = a.getResourceId(R.styleable.SkinCompatImageView_srcCompat, INVALID_ID);
        srcCompatResId = checkResourceId(srcCompatResId);
        if (srcCompatResId != INVALID_ID) {
            mSrcResId = srcCompatResId;
        }
    } finally {
        if (a != null) {
            a.recycle();
        }
    }
    applySkin();
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:18,代码来源:SkinCompatImageHelper.java

示例3: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
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();
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:14,代码来源:SkinCompatBackgroundHelper.java

示例4: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    final Context context = mView.getContext();

    // First read the TextAppearance style id
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs,
            R.styleable.SkinCompatTextHelper, defStyleAttr, 0);
    final int ap = a.getResourceId(R.styleable.SkinCompatTextHelper_android_textAppearance, INVALID_ID);
    SkinLog.d(TAG, "ap = " + ap);
    a.recycle();

    if (ap != INVALID_ID) {
        a = TintTypedArray.obtainStyledAttributes(context, ap, R.styleable.SkinTextAppearance);
        if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
            mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
            SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
        }
        if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
            mTextColorHintResId = a.getResourceId(
                    R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
            SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
        }
        a.recycle();
    }

    // Now read the style's values
    a = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.SkinTextAppearance,
            defStyleAttr, 0);
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
        mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
    }
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
        mTextColorHintResId = a.getResourceId(
                R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
        SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
    }
    a.recycle();
    applySkin();
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:40,代码来源:SkinCompatTextHelper.java

示例5: onSetTextAppearance

import skin.support.R; //导入依赖的package包/类
public void onSetTextAppearance(Context context, int resId) {
    final TintTypedArray a = TintTypedArray.obtainStyledAttributes(context,
            resId, R.styleable.SkinTextAppearance);
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
        mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
    }
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
        mTextColorHintResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
        SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
    }
    a.recycle();
    applySkin();
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:15,代码来源:SkinCompatTextHelper.java

示例6: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
@Override
    void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
        super.loadFromAttributes(attrs, defStyleAttr);

        TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
                R.styleable.AppCompatSeekBar, defStyleAttr, 0);
        mThumbResId = a.getResourceId(R.styleable.AppCompatSeekBar_android_thumb, INVALID_ID);
//        final Drawable drawable = a.getDrawableIfKnown(R.styleable.AppCompatSeekBar_android_thumb);
//        if (drawable != null) {
//            mView.setThumb(drawable);
//        }

//        mTickMarkResId = a.getResourceId(R.styleable.AppCompatSeekBar_tickMark, INVALID_ID);
//        final Drawable tickMark = a.getDrawable(R.styleable.AppCompatSeekBar_tickMark);
//        setTickMark(tickMark);

//        if (a.hasValue(R.styleable.AppCompatSeekBar_tickMarkTintMode)) {
//            mTickMarkTintMode = DrawableUtils.parseTintMode(a.getInt(
//                    R.styleable.AppCompatSeekBar_tickMarkTintMode, -1), mTickMarkTintMode);
//            mHasTickMarkTintMode = true;
//        }

//        if (a.hasValue(R.styleable.AppCompatSeekBar_tickMarkTint)) {
//            mTickMarkTintList = a.getColorStateList(R.styleable.AppCompatSeekBar_tickMarkTint);
//            mHasTickMarkTint = true;
//        }

        a.recycle();

//        applyTickMarkTint();
        applySkin();
    }
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:33,代码来源:SkinCompatSeekBarHelper.java

示例7: SkinCompatToolbar

import skin.support.R; //导入依赖的package包/类
public SkinCompatToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
    mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);

    TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
            R.styleable.Toolbar, defStyleAttr, 0);
    mNavigationIconResId = a.getResourceId(R.styleable.Toolbar_navigationIcon, INVALID_ID);

    int titleAp = a.getResourceId(R.styleable.Toolbar_titleTextAppearance, INVALID_ID);
    int subtitleAp = a.getResourceId(R.styleable.Toolbar_subtitleTextAppearance, INVALID_ID);
    a.recycle();
    if (titleAp != INVALID_ID) {
        a = TintTypedArray.obtainStyledAttributes(context, titleAp, R.styleable.SkinTextAppearance);
        mTitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        a.recycle();
    }
    if (subtitleAp != INVALID_ID) {
        a = TintTypedArray.obtainStyledAttributes(context, subtitleAp, R.styleable.SkinTextAppearance);
        mSubtitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        a.recycle();
    }
    a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
            R.styleable.Toolbar, defStyleAttr, 0);
    if (a.hasValue(R.styleable.Toolbar_titleTextColor)) {
        mTitleTextColorResId = a.getResourceId(R.styleable.Toolbar_titleTextColor, INVALID_ID);
    }
    if (a.hasValue(R.styleable.Toolbar_subtitleTextColor)) {
        mSubtitleTextColorResId = a.getResourceId(R.styleable.Toolbar_subtitleTextColor, INVALID_ID);
    }
    a.recycle();
    applyTitleTextColor();
    applySubtitleTextColor();
    applyNavigationIcon();
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:36,代码来源:SkinCompatToolbar.java

示例8: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
        TypedArray a = mView.getContext().obtainStyledAttributes(attrs, R.styleable.CompoundButton,
                defStyleAttr, INVALID_ID);
        try {
            if (a.hasValue(R.styleable.CompoundButton_android_button)) {
                mButtonResourceId = a.getResourceId(
                        R.styleable.CompoundButton_android_button, INVALID_ID);
            }
//                if (resourceId != 0) {
//                    mView.setButtonDrawable(
//                            AppCompatResources.getDrawable(mView.getContext(), resourceId));
//                }
//            }
//            if (a.hasValue(R.styleable.CompoundButton_buttonTint)) {
//                CompoundButtonCompat.setButtonTintList(mView,
//                        a.getColorStateList(R.styleable.CompoundButton_buttonTint));
//            }
//            if (a.hasValue(R.styleable.CompoundButton_buttonTintMode)) {
//                CompoundButtonCompat.setButtonTintMode(mView,
//                        DrawableUtils.parseTintMode(
//                                a.getInt(R.styleable.CompoundButton_buttonTintMode, -1),
//                                null));
//            }
        } finally {
            a.recycle();
        }
        applySkin();
    }
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:29,代码来源:SkinCompatCompoundButtonHelper.java

示例9: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
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, -1);
    } finally {
        if (a != null) {
            a.recycle();
        }
    }
    applySkin();
}
 
开发者ID:wutongke,项目名称:AndroidSkinAnimator,代码行数:15,代码来源:SkinCompatImageHelper.java

示例10: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TypedArray a = mView.getContext().obtainStyledAttributes(attrs, R.styleable.SkinCompatProgressBar, defStyleAttr, 0);

    mIndeterminateDrawableResId = a.getResourceId(R.styleable.SkinCompatProgressBar_android_indeterminateDrawable, INVALID_ID);
    mProgressDrawableResId = a.getResourceId(R.styleable.SkinCompatProgressBar_android_progressDrawable, INVALID_ID);

    a.recycle();
    if (Build.VERSION.SDK_INT > 21) {
        a = mView.getContext().obtainStyledAttributes(attrs, new int[]{android.R.attr.indeterminateTint}, defStyleAttr, 0);
        mIndeterminateTintResId = a.getResourceId(0, INVALID_ID);
        a.recycle();
    }
    applySkin();
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:15,代码来源:SkinCompatProgressBarHelper.java

示例11: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
    TypedArray a = mView.getContext().obtainStyledAttributes(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();
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:13,代码来源:SkinCompatBackgroundHelper.java

示例12: SkinCompatSpinner

import skin.support.R; //导入依赖的package包/类
public SkinCompatSpinner(Context context, AttributeSet attrs, int defStyleAttr, int mode, Resources.Theme popupTheme) {
    super(context, attrs, defStyleAttr, mode, popupTheme);
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Spinner, defStyleAttr, 0);

    if (getPopupContext() != null) {
        if (mode == MODE_THEME) {
            if (Build.VERSION.SDK_INT >= 11) {
                // If we're running on API v11+ we will try and read android:spinnerMode
                TypedArray aa = null;
                try {
                    aa = context.obtainStyledAttributes(attrs, ATTRS_ANDROID_SPINNERMODE,
                            defStyleAttr, 0);
                    if (aa.hasValue(0)) {
                        mode = aa.getInt(0, MODE_DIALOG);
                    }
                } catch (Exception e) {
                    Log.i(TAG, "Could not read android:spinnerMode", e);
                } finally {
                    if (aa != null) {
                        aa.recycle();
                    }
                }
            } else {
                // Else, we use a default mode of dropdown
                mode = MODE_DROPDOWN;
            }
        }

        if (mode == MODE_DROPDOWN) {
            final TypedArray pa = getPopupContext().obtainStyledAttributes(attrs, R.styleable.Spinner, defStyleAttr, 0);
            mPopupBackgroundResId = pa.getResourceId(R.styleable.Spinner_android_popupBackground, INVALID_ID);
            pa.recycle();
        }
    }
    a.recycle();

    mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
    mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:40,代码来源:SkinCompatSpinner.java

示例13: onSetTextAppearance

import skin.support.R; //导入依赖的package包/类
public void onSetTextAppearance(Context context, int resId) {
    final TypedArray a = context.obtainStyledAttributes(resId, R.styleable.SkinTextAppearance);
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
        mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
    }
    if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
        mTextColorHintResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
    }
    a.recycle();
    applyTextColorResource();
    applyTextColorHintResource();
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:13,代码来源:SkinCompatTextHelper.java

示例14: loadFromAttributes

import skin.support.R; //导入依赖的package包/类
@Override
    void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
        super.loadFromAttributes(attrs, defStyleAttr);

        TypedArray a = mView.getContext().obtainStyledAttributes(attrs, R.styleable.AppCompatSeekBar, defStyleAttr, 0);
        mThumbResId = a.getResourceId(R.styleable.AppCompatSeekBar_android_thumb, INVALID_ID);
//        final Drawable drawable = a.getDrawableIfKnown(R.styleable.AppCompatSeekBar_android_thumb);
//        if (drawable != null) {
//            mView.setThumb(drawable);
//        }

//        mTickMarkResId = a.getResourceId(R.styleable.AppCompatSeekBar_tickMark, INVALID_ID);
//        final Drawable tickMark = a.getDrawable(R.styleable.AppCompatSeekBar_tickMark);
//        setTickMark(tickMark);

//        if (a.hasValue(R.styleable.AppCompatSeekBar_tickMarkTintMode)) {
//            mTickMarkTintMode = DrawableUtils.parseTintMode(a.getInt(
//                    R.styleable.AppCompatSeekBar_tickMarkTintMode, -1), mTickMarkTintMode);
//            mHasTickMarkTintMode = true;
//        }

//        if (a.hasValue(R.styleable.AppCompatSeekBar_tickMarkTint)) {
//            mTickMarkTintList = a.getColorStateList(R.styleable.AppCompatSeekBar_tickMarkTint);
//            mHasTickMarkTint = true;
//        }

        a.recycle();

//        applyTickMarkTint();
        applySkin();
    }
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:32,代码来源:SkinCompatSeekBarHelper.java

示例15: SkinCompatToolbar

import skin.support.R; //导入依赖的package包/类
public SkinCompatToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
    mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Toolbar, defStyleAttr, 0);
    mNavigationIconResId = a.getResourceId(R.styleable.Toolbar_navigationIcon, INVALID_ID);

    int titleAp = a.getResourceId(R.styleable.Toolbar_titleTextAppearance, INVALID_ID);
    int subtitleAp = a.getResourceId(R.styleable.Toolbar_subtitleTextAppearance, INVALID_ID);
    a.recycle();
    if (titleAp != INVALID_ID) {
        a = context.obtainStyledAttributes(titleAp, R.styleable.SkinTextAppearance);
        mTitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        a.recycle();
    }
    if (subtitleAp != INVALID_ID) {
        a = context.obtainStyledAttributes(subtitleAp, R.styleable.SkinTextAppearance);
        mSubtitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
        a.recycle();
    }
    a = context.obtainStyledAttributes(attrs, R.styleable.Toolbar, defStyleAttr, 0);
    if (a.hasValue(R.styleable.Toolbar_titleTextColor)) {
        mTitleTextColorResId = a.getResourceId(R.styleable.Toolbar_titleTextColor, INVALID_ID);
    }
    if (a.hasValue(R.styleable.Toolbar_subtitleTextColor)) {
        mSubtitleTextColorResId = a.getResourceId(R.styleable.Toolbar_subtitleTextColor, INVALID_ID);
    }
    a.recycle();
    applyTitleTextColor();
    applySubtitleTextColor();
    applyNavigationIcon();
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:34,代码来源:SkinCompatToolbar.java


注:本文中的skin.support.R类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。