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


Java R类代码示例

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


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

示例1: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    mBallPulseView = new BallPulseView(context);
    addView(mBallPulseView, WRAP_CONTENT, WRAP_CONTENT);
    setMinimumHeight(DensityUtil.dp2px(60));

    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BallPulseFooter);

    int primaryColor = ta.getColor(R.styleable.BallPulseFooter_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.BallPulseFooter_srlAccentColor, 0);
    if (primaryColor != 0) {
        mBallPulseView.setNormalColor(primaryColor);
    }
    if (accentColor != 0) {
        mBallPulseView.setAnimatingColor(accentColor);
    }

    mSpinnerStyle = SpinnerStyle.values()[ta.getInt(R.styleable.BallPulseFooter_srlClassicsSpinnerStyle, mSpinnerStyle.ordinal())];

    ta.recycle();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:BallPulseFooter.java

示例2: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    mBallPulseView = new BallPulseView(context);
    addView(mBallPulseView, WRAP_CONTENT, WRAP_CONTENT);
    setMinimumHeight(DensityUtil.dp2px(60));

    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BallPulseFooter);

    int primaryColor = ta.getColor(R.styleable.BallPulseFooter_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.BallPulseFooter_srlAccentColor, 0);
    if (primaryColor != 0) {
        mBallPulseView.setAnimatingColor(primaryColor);
    }
    if (accentColor != 0) {
        mBallPulseView.setNormalColor(primaryColor);
    }

    mSpinnerStyle = SpinnerStyle.values()[ta.getInt(R.styleable.BallPulseFooter_srlClassicsSpinnerStyle, mSpinnerStyle.ordinal())];

    ta.recycle();
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:21,代码来源:BallPulseFooter.java

示例3: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    setMinimumHeight(DensityUtil.dp2px(100));
    /**
     * 初始化headView
     */
    mWaveView = new WaveView(getContext());
    mRippleView = new RippleView(getContext());
    mDotView = new RoundDotView(getContext());
    mProgressView = new RoundProgressView(getContext());
    if (isInEditMode()) {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        mWaveView.setHeadHeight(1000);
    } else {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mDotView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mRippleView, MATCH_PARENT, MATCH_PARENT);
        mProgressView.setScaleX(0);
        mProgressView.setScaleY(0);
    }


    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BezierRadarHeader);

    mEnableHorizontalDrag = ta.getBoolean(R.styleable.BezierRadarHeader_srlEnableHorizontalDrag, mEnableHorizontalDrag);
    int primaryColor = ta.getColor(R.styleable.BezierRadarHeader_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.BezierRadarHeader_srlAccentColor, 0);
    if (primaryColor != 0) {
        setPrimaryColor(primaryColor);
    }
    if (accentColor != 0) {
        setAccentColor(primaryColor);
    }

    ta.recycle();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:38,代码来源:BezierRadarHeader.java

示例4: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    setMinimumHeight(DensityUtil.dp2px(100));
    /**
     * 初始化headView
     */
    mWaveView = new WaveView(getContext());
    mRippleView = new RippleView(getContext());
    mDotView = new RoundDotView(getContext());
    mProgressView = new RoundProgressView(getContext());
    if (isInEditMode()) {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        mWaveView.setHeadHeight(1000);
    } else {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mDotView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mRippleView, MATCH_PARENT, MATCH_PARENT);
        mProgressView.setScaleX(0);
        mProgressView.setScaleY(0);
    }


    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BezierRadarHeader);

    int primaryColor = ta.getColor(R.styleable.BezierRadarHeader_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.BezierRadarHeader_srlAccentColor, 0);
    if (primaryColor != 0) {
        setPrimaryColor(primaryColor);
    }
    if (accentColor != 0) {
        setAccentColor(primaryColor);
    }

    ta.recycle();
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:37,代码来源:BezierRadarHeader.java

示例5: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    setMinimumHeight(DensityUtil.dp2px(100));
    /**
     * 初始化headView
     */
    mWaveView = new WaveView(getContext());
    mRippleView = new RippleView(getContext());
    mDotView = new RoundDotView(getContext());
    mProgressView = new RoundProgressView(getContext());
    if (isInEditMode()) {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        mWaveView.setHeadHeight(1000);
    } else {
        this.addView(mWaveView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mDotView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mProgressView, MATCH_PARENT, MATCH_PARENT);
        this.addView(mRippleView, MATCH_PARENT, MATCH_PARENT);
        mProgressView.setScaleX(0);
        mProgressView.setScaleY(0);
    }


    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BezierRadarHeader);

    mEnableHorizontalDrag = ta.getBoolean(R.styleable.BezierRadarHeader_srlEnableHorizontalDrag, mEnableHorizontalDrag);
    int primaryColor = ta.getColor(R.styleable.BezierRadarHeader_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.BezierRadarHeader_srlAccentColor, 0);
    if (primaryColor != 0) {
        setPrimaryColor(primaryColor);
    }
    if (accentColor != 0) {
        setAccentColor(accentColor);
    }

    ta.recycle();
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:38,代码来源:BezierRadarHeader.java

示例6: initView

import com.scwang.smartrefresh.layout.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
    DensityUtil density = new DensityUtil();

    setMinimumHeight(density.dip2px(80));

    mProgressDrawable = new ProgressDrawable();
    mProgressDrawable.setColor(0xff666666);
    mProgressView = new ImageView(context);
    mProgressView.setImageDrawable(mProgressDrawable);
    LayoutParams lpProgress = new LayoutParams(density.dip2px(20), density.dip2px(20));
    lpProgress.leftMargin = density.dip2px(80);
    lpProgress.addRule(CENTER_VERTICAL);
    lpProgress.addRule(ALIGN_PARENT_LEFT);
    addView(mProgressView, lpProgress);

    mArrowView = new PathsView(context);
    mArrowView.parserColors(0xff666666);
    mArrowView.parserPaths("M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z");
    addView(mArrowView, lpProgress);

    LinearLayout layout = new LinearLayout(context, attrs, defStyleAttr);
    layout.setGravity(Gravity.CENTER_HORIZONTAL);
    layout.setOrientation(LinearLayout.VERTICAL);
    mHeaderText = new TextView(context);
    mHeaderText.setText(REFRESH_HEADER_PULLDOWN);
    mHeaderText.setTextColor(0xff666666);
    mHeaderText.setTextSize(16);

    mLastUpdateText = new TextView(context);
    mLastUpdateText.setText(mFormat.format(new Date()));
    mLastUpdateText.setTextColor(0xff7c7c7c);
    mLastUpdateText.setTextSize(12);
    LinearLayout.LayoutParams lpHeaderText = new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
    lpHeaderText.leftMargin = density.dip2px(20);
    lpHeaderText.rightMargin = density.dip2px(20);
    layout.addView(mHeaderText, lpHeaderText);
    LinearLayout.LayoutParams lpUpdateText = new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
    layout.addView(mLastUpdateText, lpUpdateText);

    LayoutParams lpHeaderLayout = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
    lpHeaderLayout.addRule(CENTER_IN_PARENT);
    addView(layout,lpHeaderLayout);

    if (isInEditMode()) {
        mArrowView.setVisibility(GONE);
        mHeaderText.setText(REFRESH_HEADER_REFRESHING);
    } else {
        mProgressView.setVisibility(GONE);
    }


    TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ClassicsHeader);

    mSpinnerStyle = SpinnerStyle.values()[ta.getInt(R.styleable.ClassicsHeader_srlClassicsSpinnerStyle,mSpinnerStyle.ordinal())];

    int primaryColor = ta.getColor(R.styleable.ClassicsHeader_srlPrimaryColor, 0);
    int accentColor = ta.getColor(R.styleable.ClassicsHeader_srlAccentColor, 0);
    if (primaryColor != 0) {
        if (accentColor != 0) {
            setPrimaryColors(primaryColor, accentColor);
        } else {
            setPrimaryColors(primaryColor);
        }
    } else if (accentColor != 0) {
        setPrimaryColors(0, accentColor);
    }

    ta.recycle();
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:70,代码来源:ClassicsHeader.java


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