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


Java PtrIndicator.setResistanceHeader方法代码示例

本文整理汇总了Java中in.srain.cube.views.ptr.indicator.PtrIndicator.setResistanceHeader方法的典型用法代码示例。如果您正苦于以下问题:Java PtrIndicator.setResistanceHeader方法的具体用法?Java PtrIndicator.setResistanceHeader怎么用?Java PtrIndicator.setResistanceHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在in.srain.cube.views.ptr.indicator.PtrIndicator的用法示例。


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

示例1: PtrFrameLayout

import in.srain.cube.views.ptr.indicator.PtrIndicator; //导入方法依赖的package包/类
public PtrFrameLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    mPtrIndicator = new PtrIndicator();

    TypedArray arr = context.obtainStyledAttributes(attrs, R.styleable.PtrFrameLayout, 0, 0);
    if (arr != null) {
        mHeaderId = arr.getResourceId(R.styleable.PtrFrameLayout_ptr_header, mHeaderId);
        mContainerId = arr.getResourceId(R.styleable.PtrFrameLayout_ptr_content, mContainerId);
        mFooterId = arr.getResourceId(R.styleable.PtrFrameLayout_ptr_footer, mFooterId);

        mPtrIndicator.setResistanceHeader(arr.getFloat(R.styleable.PtrFrameLayout_ptr_resistance, mPtrIndicator.getResistanceHeader()));
        mPtrIndicator.setResistanceFooter(arr.getFloat(R.styleable.PtrFrameLayout_ptr_resistance, mPtrIndicator.getResistanceFooter()));
        mPtrIndicator.setResistanceHeader(arr.getFloat(R.styleable.PtrFrameLayout_ptr_resistance_header, mPtrIndicator.getResistanceHeader()));
        mPtrIndicator.setResistanceFooter(arr.getFloat(R.styleable.PtrFrameLayout_ptr_resistance_footer, mPtrIndicator.getResistanceFooter()));

        mDurationToBackHeader = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_back_refresh, mDurationToCloseHeader);
        mDurationToBackFooter = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_back_refresh, mDurationToCloseHeader);
        mDurationToBackHeader = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_back_header, mDurationToCloseHeader);
        mDurationToBackFooter = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_back_footer, mDurationToCloseHeader);

        mDurationToCloseHeader = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_close_either, mDurationToCloseHeader);
        mDurationToCloseFooter = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_close_either, mDurationToCloseFooter);
        mDurationToCloseHeader = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_close_header, mDurationToCloseHeader);
        mDurationToCloseFooter = arr.getInt(R.styleable.PtrFrameLayout_ptr_duration_to_close_footer, mDurationToCloseFooter);

        float ratio = mPtrIndicator.getRatioOfHeaderToHeightRefresh();
        ratio = arr.getFloat(R.styleable.PtrFrameLayout_ptr_ratio_of_header_height_to_refresh, ratio);
        mPtrIndicator.setRatioOfHeaderHeightToRefresh(ratio);

        mKeepHeaderWhenRefresh = arr.getBoolean(R.styleable.PtrFrameLayout_ptr_keep_header_when_refresh, mKeepHeaderWhenRefresh);

        mPullToRefresh = arr.getBoolean(R.styleable.PtrFrameLayout_ptr_pull_to_fresh, mPullToRefresh);

        mMode = getModeFromIndex(arr.getInt(R.styleable.PtrFrameLayout_ptr_mode, 4));

        arr.recycle();
    }

    mScrollChecker = new ScrollChecker();

    final ViewConfiguration conf = ViewConfiguration.get(getContext());
    mPagingTouchSlop = conf.getScaledTouchSlop() * 2;
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:45,代码来源:PtrFrameLayout.java


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