本文整理汇总了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();
}