• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SpinnerStyle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Options类代码示例发布时间:2022-05-23
下一篇:
Java PowerDatacenter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap