本文整理汇总了Java中com.scwang.smartrefresh.layout.internal.pathview.PathsView类的典型用法代码示例。如果您正苦于以下问题:Java PathsView类的具体用法?Java PathsView怎么用?Java PathsView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PathsView类属于com.scwang.smartrefresh.layout.internal.pathview包,在下文中一共展示了PathsView类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.scwang.smartrefresh.layout.internal.pathview.PathsView; //导入依赖的package包/类
private void initView(Context context) {
setGravity(Gravity.CENTER);
mHeaderText = new TextView(context);
mProgressDrawable = new ProgressDrawable();
mArrowView = new PathsView(context);
mProgressView = new ImageView(context);
mProgressView.setImageDrawable(mProgressDrawable);
mArrowView.parserPaths("M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z");
addView(mProgressView, DensityUtil.dp2px(20), DensityUtil.dp2px(20));
addView(mArrowView, DensityUtil.dp2px(20), DensityUtil.dp2px(20));
addView(new View(context), DensityUtil.dp2px(20), DensityUtil.dp2px(20));
addView(mHeaderText, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
setMinimumHeight(DensityUtil.dp2px(60));
}
示例2: initView
import com.scwang.smartrefresh.layout.internal.pathview.PathsView; //导入依赖的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();
}