本文整理匯總了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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例13: setUp
import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
public void setUp(PtrFrameLayout ptrFrameLayout) {
mPtrFrameLayout = ptrFrameLayout;
mPtrTensionIndicator = new PtrTensionIndicator();
mPtrFrameLayout.setPtrIndicator(mPtrTensionIndicator);
}
示例14: onUIReset
import in.srain.cube.views.ptr.PtrFrameLayout; //導入依賴的package包/類
@Override
public void onUIReset(PtrFrameLayout frame) {
mDrawable.resetOriginals();
}
示例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();
}