當前位置: 首頁>>代碼示例>>Java>>正文


Java PtrFrameLayout類代碼示例

本文整理匯總了Java中in.srain.cube.views.ptr.PtrFrameLayout的典型用法代碼示例。如果您正苦於以下問題:Java PtrFrameLayout類的具體用法?Java PtrFrameLayout怎麽用?Java PtrFrameLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PtrFrameLayout類屬於in.srain.cube.views.ptr包,在下文中一共展示了PtrFrameLayout類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onUIPositionChange

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIPositionChange(PtrFrameLayout frame, boolean isUnderTouch, byte status, PtrIndicator ptrIndicator) {

    float percent = Math.min(1f, ptrIndicator.getCurrentPercent());

    if (status == PtrFrameLayout.PTR_STATUS_PREPARE) {
        mDrawable.setAlpha((int) (255 * percent));
        mDrawable.showArrow(true);

        float strokeStart = ((percent) * .8f);
        mDrawable.setStartEndTrim(0f, Math.min(0.8f, strokeStart));
        mDrawable.setArrowScale(Math.min(1f, percent));

        // magic
        float rotation = (-0.25f + .4f * percent + percent * 2) * .5f;
        mDrawable.setProgressRotation(rotation);
        invalidate();
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:20,代碼來源:MaterialHeader.java

示例2: getBaseInfo

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public void getBaseInfo(PtrFrameLayout ptrFrame) {
        if (!NetworkUtils.isNetworkAvaliable(getActivity())) {
            ToastUtil.showToast(getActivity(), R.string.net_error);
            //TODO
            List<Rows> devices = (List<Rows>) SharedPreferencesUtils.getObject(getActivity(), SharedPreferencesUtils.KEY_DEVICE_LIST, null);
            if (null != devices && devices.size() > 0) {
                deviceList.clear();
                deviceList.addAll(devices);
            }
            if (devicesListAdapter != null) {
                //更新數據
                Log.d("XLight", "update device list");
                codeChange = true;
                devicesListAdapter.notifyDataSetChanged();
                codeChange = false;
            }
            addDeviceMapsSDK(deviceList);
            return;
        }
//        if (!UserUtils.isLogin(getActivity())) {
//            return;
//        }
        refreshDeviceInfo(ptrFrame);
    }
 
開發者ID:Datatellit,項目名稱:xlight_android_native,代碼行數:25,代碼來源:GlanceMainFragment.java

示例3: setCustomSwipeToRefresh

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public void setCustomSwipeToRefresh() {
    mPtrFrameLayout = (PtrFrameLayout) findViewById(R.id.store_house_ptr_frame);
    mPtrFrameLayout.setResistance(1.7f);
    mPtrFrameLayout.setRatioOfHeaderHeightToRefresh(1.2f);
    mPtrFrameLayout.setDurationToClose(200);
    mPtrFrameLayout.setDurationToCloseHeader(1000);
    mPtrFrameLayout.setPullToRefresh(false);
    mPtrFrameLayout.setKeepHeaderWhenRefresh(true);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:CustomUltimateRecyclerview.java

示例4: onCreate

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    instance = this;

    String environment = "";

    if (environment.equals("production")) {
        CLog.setLogLevel(CLog.LEVEL_ERROR);
    } else if (environment.equals("beta")) {
        CLog.setLogLevel(CLog.LEVEL_WARNING);
    } else {
        // development
        CLog.setLogLevel(CLog.LEVEL_VERBOSE);
    }

    CubeDebug.DEBUG_IMAGE = true;
    PtrFrameLayout.DEBUG = true;
    PtrFrameLayout.DEBUG = false;

    ImageLoaderFactory.setDefaultImageReSizer(DemoDuiTangImageReSizer.getInstance());
    ImageLoaderFactory.setDefaultImageLoadHandler(new PtrImageLoadHandler());
    String dir = "request-cache";
    // ImageLoaderFactory.init(this);
    RequestCacheManager.init(this, dir, 1024 * 10, 1024 * 10);
    Cube.onCreate(this);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:28,代碼來源:PtrDemoApplication.java

示例5: onUIRefreshBegin

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIRefreshBegin(PtrFrameLayout frame) {
    mDrawable.start();
    float percent = mPtrTensionIndicator.getOverDragPercent();
    mDrawable.offsetTopAndBottom(mPtrTensionIndicator.getCurrentPosY());
    mDrawable.setPercent(percent);
    invalidate();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:RentalsSunHeaderView.java

示例6: onUIPositionChange

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIPositionChange(PtrFrameLayout frame, boolean isUnderTouch, byte status, PtrIndicator ptrIndicator) {
    float percent = mPtrTensionIndicator.getOverDragPercent();
    mDrawable.offsetTopAndBottom(mPtrTensionIndicator.getCurrentPosY());
    mDrawable.setPercent(percent);
    invalidate();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:RentalsSunHeaderView.java

示例7: initViews

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
protected void initViews(View contentView) {
    filesListView = (ListView) rootView.findViewById(R.id.filesListview);

    mAdapter = new FileListAdapter(getActivity());
    
    filesListView.setAdapter(mAdapter);

    refreshLayout = (PtrFrameLayout) rootView.findViewById(R.id.refreshLayout);
    // 這句話是為了,第一次進入頁麵的時候顯示加載進度條
    refreshLayout.autoRefresh(true,1000);
}
 
開發者ID:tryBetter,項目名稱:minVideo,代碼行數:13,代碼來源:FileListFragment.java

示例8: onUIReset

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIReset(PtrFrameLayout frame) {
    loadFinish();
    for (int i = 0; i < mItemList.size(); i++) {
        mItemList.get(i).resetPosition(mHorizontalRandomness);

    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:StoreHouseHeader.java

示例9: onUIPositionChange

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIPositionChange(PtrFrameLayout frame, boolean isUnderTouch, byte status, PtrIndicator ptrIndicator) {

    float currentPercent = Math.min(1f, ptrIndicator.getCurrentPercent());
    setProgress(currentPercent);
    invalidate();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:StoreHouseHeader.java

示例10: onUIRefreshComplete

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIRefreshComplete(PtrFrameLayout frame) {
    float percent = mPtrTensionIndicator.getOverDragPercent();
    mDrawable.stop();
    mDrawable.offsetTopAndBottom(mPtrTensionIndicator.getCurrentPosY());
    mDrawable.setPercent(percent);
    invalidate();
}
 
開發者ID:qianxinyi,項目名稱:DripUltraRefreshWithLoad,代碼行數:9,代碼來源:RentalsSunHeaderView.java

示例11: create

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public static BuilderStep1 create(PtrFrameLayout ptrFrameLayout) {
    IPullView pullView = PtrFramePullView.create(ptrFrameLayout);
    IListWrapper listWrapper = null;
    if ((listWrapper = createListWrapper(ptrFrameLayout.getContentView())) == null) {
        throw new IllegalArgumentException("can not find recyclerview or listview in ptrFrameLayout");
    }
    return new BuilderStep1(pullView, listWrapper);
}
 
開發者ID:liyuanhust,項目名稱:LoadMoreHelper,代碼行數:9,代碼來源:LoadMoreHelper.java

示例12: onUIReset

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public void onUIReset(PtrFrameLayout frame) {
    loadFinish();
    for (int i = 0; i < mItemList.size(); i++) {
        mItemList.get(i).resetPosition(mHorizontalRandomness);

    }
}
 
開發者ID:qianxinyi,項目名稱:DripUltraRefreshWithLoad,代碼行數:8,代碼來源:StoreHouseFooter.java

示例13: setUp

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public void setUp(PtrFrameLayout ptrFrameLayout) {
    mPtrFrameLayout = ptrFrameLayout;
    mPtrTensionIndicator = new PtrTensionIndicator();
    mPtrFrameLayout.setPtrIndicator(mPtrTensionIndicator);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:RentalsSunHeaderView.java

示例14: onUIReset

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIReset(PtrFrameLayout frame) {
    mDrawable.resetOriginals();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:RentalsSunHeaderView.java

示例15: onUIReset

import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
/**
 * When the content view has reached top and refresh has been completed, view will be reset.
 *
 * @param frame
 */
@Override
public void onUIReset(PtrFrameLayout frame) {
    mScale = 1f;
    mDrawable.stop();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:MaterialHeader.java


注:本文中的in.srain.cube.views.ptr.PtrFrameLayout類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。