本文整理汇总了Java中com.scwang.smartrefresh.layout.constant.SpinnerStyle类的典型用法代码示例。如果您正苦于以下问题:Java SpinnerStyle类的具体用法?Java SpinnerStyle怎么用?Java SpinnerStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpinnerStyle类属于com.scwang.smartrefresh.layout.constant包,在下文中一共展示了SpinnerStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onLayout
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
final int paddingLeft = getPaddingLeft();
final int paddingTop = getPaddingTop();
final int paddingBottom = getPaddingBottom();
if (mRefreshContent != null) {
boolean isInEditMode = isInEditMode() && mEnablePreviewInEditMode;
final LayoutParams lp = (LayoutParams) mRefreshContent.getLayoutParams();
int left = paddingLeft + lp.leftMargin;
int top = paddingTop + lp.topMargin;
int right = left + mRefreshContent.getMeasuredWidth();
int bottom = top + mRefreshContent.getMeasuredHeight();
if (isInEditMode && mRefreshHeader != null && (mEnableHeaderTranslationContent || mRefreshHeader.getSpinnerStyle() == SpinnerStyle.FixedBehind)) {
top = top + mHeaderHeight;
bottom = bottom + mHeaderHeight;
}
mRefreshContent.layout(left, top, right, bottom);
}
layoutHeader();
layoutFooter();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:SmartRefreshLayout.java
示例2: layoutFooter
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
protected void layoutFooter() {
if (mRefreshFooter != null) {
boolean isInEditMode = isInEditMode() && mEnablePreviewInEditMode;
final View footerView = mRefreshFooter.getView();
final LayoutParams lp = (LayoutParams) footerView.getLayoutParams();
final SpinnerStyle style = mRefreshFooter.getSpinnerStyle();
int left = lp.leftMargin;
int top = lp.topMargin + getMeasuredHeight() - lp.bottomMargin;
if (isInEditMode
|| style == SpinnerStyle.FixedFront
|| style == SpinnerStyle.FixedBehind) {
top = top - mFooterHeight;
} else if (style == SpinnerStyle.Scale || style == SpinnerStyle.Translate) {
top = top - Math.max(Math.max(-mSpinner, 0) - lp.topMargin, 0);
}
int right = left + footerView.getMeasuredWidth();
int bottom = top + footerView.getMeasuredHeight();
footerView.layout(left, top, right, bottom);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:SmartRefreshLayout.java
示例3: layoutHeader
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
protected void layoutHeader() {
if (mRefreshHeader != null) {
boolean isInEditMode = isInEditMode() && mEnablePreviewInEditMode;
final View headerView = mRefreshHeader.getView();
final LayoutParams lp = (LayoutParams) headerView.getLayoutParams();
int left = lp.leftMargin;
int top = lp.topMargin;
int right = left + headerView.getMeasuredWidth();
int bottom = top + headerView.getMeasuredHeight();
if (!isInEditMode) {
if (mRefreshHeader.getSpinnerStyle() == SpinnerStyle.Translate) {
top = top - mHeaderHeight + Math.max(0, mSpinner);
bottom = top + headerView.getMeasuredHeight();
} else if (mRefreshHeader.getSpinnerStyle() == SpinnerStyle.Scale) {
bottom = top + Math.max(Math.max(0, mSpinner) - lp.bottomMargin, 0);
}
}
headerView.layout(left, top, right, bottom);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:SmartRefreshLayout.java
示例4: setRefreshHeader
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* 设置指定的Header
*/
@Override
public SmartRefreshLayout setRefreshHeader(RefreshHeader header) {
if (header != null) {
if (mRefreshHeader != null) {
removeView(mRefreshHeader.getView());
}
this.mRefreshHeader = header;
this.mHeaderHeightStatus = mHeaderHeightStatus.unNotify();
if (header.getSpinnerStyle() == SpinnerStyle.FixedBehind) {
this.addView(mRefreshHeader.getView(), 0, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
} else {
this.addView(mRefreshHeader.getView(), MATCH_PARENT, WRAP_CONTENT);
}
}
return this;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:SmartRefreshLayout.java
示例5: setRefreshFooter
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* 设置指定的Footer
*/
@Override
public SmartRefreshLayout setRefreshFooter(RefreshFooter footer) {
if (footer != null) {
if (mRefreshFooter != null) {
removeView(mRefreshFooter.getView());
}
this.mRefreshFooter = footer;
this.mFooterHeightStatus = mFooterHeightStatus.unNotify();
this.mEnableLoadmore = !mManualLoadmore || mEnableLoadmore;
if (mRefreshFooter.getSpinnerStyle() == SpinnerStyle.FixedBehind) {
this.addView(mRefreshFooter.getView(), 0, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
} else {
this.addView(mRefreshFooter.getView(), MATCH_PARENT, WRAP_CONTENT);
}
}
return this;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:SmartRefreshLayout.java
示例6: getSpinnerStyle
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == ViewGroup.LayoutParams.MATCH_PARENT) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:RefreshHeaderWrapper.java
示例7: getSpinnerStyle
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == 0) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RefreshFooterWrapper.java
示例8: setPrimaryColors
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* ClassicsFooter 在(SpinnerStyle.FixedBehind)时才有主题色
*/
@[email protected]
public void setPrimaryColors(@ColorInt int ... colors) {
if (mSpinnerStyle == SpinnerStyle.FixedBehind) {
if (colors.length > 0) {
if (!(getBackground() instanceof BitmapDrawable)) {
setPrimaryColor(colors[0]);
}
if (colors.length > 1) {
setAccentColor(colors[1]);
} else {
setAccentColor(colors[0] == 0xffffffff ? 0xff666666 : 0xffffffff);
}
}
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:ClassicsFooter.java
示例9: initView
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的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
示例10: setPrimaryColors
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* ClassicsFooter 没有主题色
* ClassicsFooter has no primary colors
*/
@Override
public void setPrimaryColors(int... colors) {
if (mSpinnerStyle == SpinnerStyle.FixedBehind) {
if (colors.length > 1) {
setBackgroundColor(colors[0]);
mBottomText.setTextColor(colors[1]);
mProgressDrawable.setColor(colors[1]);
} else if (colors.length > 0) {
setBackgroundColor(colors[0]);
if (colors[0] == 0xffffffff) {
mBottomText.setTextColor(0xff666666);
mProgressDrawable.setColor(0xff666666);
} else {
mBottomText.setTextColor(0xffffffff);
mProgressDrawable.setColor(0xffffffff);
}
}
}
}
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:25,代码来源:ClassicsFooter.java
示例11: initView
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的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
示例12: setRefreshHeader
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* 设置指定的Header
*/
@Override
public SmartRefreshLayout setRefreshHeader(RefreshHeader header, int width, int height) {
if (header != null) {
if (mRefreshHeader != null) {
removeView(mRefreshHeader.getView());
}
this.mRefreshHeader = header;
this.mHeaderHeightStatus = mHeaderHeightStatus.unNotify();
if (header.getSpinnerStyle() == SpinnerStyle.FixedBehind) {
this.addView(mRefreshHeader.getView(), 0, new LayoutParams(width, height));
} else {
this.addView(mRefreshHeader.getView(), width, height);
}
}
return this;
}
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:20,代码来源:SmartRefreshLayout.java
示例13: setRefreshFooter
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
/**
* 设置指定的Footer
*/
@Override
public SmartRefreshLayout setRefreshFooter(RefreshFooter footer, int width, int height) {
if (footer != null) {
if (mRefreshFooter != null) {
removeView(mRefreshFooter.getView());
}
this.mRefreshFooter = footer;
this.mFooterHeightStatus = mFooterHeightStatus.unNotify();
this.mEnableLoadmore = !mManualLoadmore || mEnableLoadmore;
if (mRefreshFooter.getSpinnerStyle() == SpinnerStyle.FixedBehind) {
this.addView(mRefreshFooter.getView(), 0, new LayoutParams(width, height));
} else {
this.addView(mRefreshFooter.getView(), width, height);
}
}
return this;
}
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:21,代码来源:SmartRefreshLayout.java
示例14: getSpinnerStyle
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == 0) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:21,代码来源:RefreshFooterWrapper.java
示例15: LayoutParams
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
public LayoutParams(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SmartRefreshLayout_Layout);
backgroundColor = ta.getColor(R.styleable.SmartRefreshLayout_Layout_layout_srlBackgroundColor, backgroundColor);
if (ta.hasValue(R.styleable.SmartRefreshLayout_Layout_layout_srlSpinnerStyle)) {
spinnerStyle = SpinnerStyle.values()[ta.getInt(R.styleable.SmartRefreshLayout_Layout_layout_srlSpinnerStyle, SpinnerStyle.Translate.ordinal())];
}
ta.recycle();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SmartRefreshLayout.java
示例16: createRefreshHeader
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@NonNull
@Override
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
ClassicsHeader header = new ClassicsHeader(context).setSpinnerStyle(SpinnerStyle.FixedBehind);
header.setPrimaryColors(ContextCompat.getColor(context, R.color.colorPrimary), ContextCompat.getColor(context, android.R.color.white));
return header;//指定为经典Header,默认是 贝塞尔雷达Header
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:AssignDefaultUsingActivity.java
示例17: createRefreshFooter
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@NonNull
@Override
public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) {
layout.setEnableLoadmoreWhenContentNotFull(true);
ClassicsFooter footer = new ClassicsFooter(context);
footer.setBackgroundResource(android.R.color.white);
footer.setSpinnerStyle(SpinnerStyle.Scale);//设置为拉伸模式
return footer;//指定为经典Footer,默认是 BallPulseFooter
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:AssignDefaultUsingActivity.java
示例18: replaceRefreshLayoutBackground
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
private void replaceRefreshLayoutBackground(RefreshLayout refreshLayout) {
if (restoreRunable == null && mSpinnerStyle == SpinnerStyle.FixedBehind) {
restoreRunable = new Runnable() {
Drawable drawable = refreshLayout.getLayout().getBackground();
@Override
public void run() {
refreshLayout.getLayout().setBackgroundDrawable(drawable);
}
};
refreshLayout.getLayout().setBackgroundDrawable(getBackground());
}
}
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:13,代码来源:ClassicsHeader.java
示例19: getSpinnerStyle
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params != null) {
if (params.height == ViewGroup.LayoutParams.MATCH_PARENT) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:15,代码来源:RefreshHeaderWrapper.java
示例20: getSpinnerStyle
import com.scwang.smartrefresh.layout.constant.SpinnerStyle; //导入依赖的package包/类
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params != null) {
if (params.height == 0) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:14,代码来源:RefreshBottomWrapper.java
注:本文中的com.scwang.smartrefresh.layout.constant.SpinnerStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论