本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}