本文整理汇总了Java中com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection类的典型用法代码示例。如果您正苦于以下问题:Java SwipyRefreshLayoutDirection类的具体用法?Java SwipyRefreshLayoutDirection怎么用?Java SwipyRefreshLayoutDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwipyRefreshLayoutDirection类属于com.orangegangsters.github.swipyrefreshlayout.library包,在下文中一共展示了SwipyRefreshLayoutDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
/*swipyRefreshLayout.measure(0, 0);
swipyRefreshLayout.setRefreshing(true);*/
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
if (isTop) {
NOW_PAGE_NUM = 1;
}
gankPresenterImpl.getGankDataFromInternet(isTop, mTitle, AppConstant.GAN_DATA_NUM, NOW_PAGE_NUM);
}
});
}
示例2: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
/* swipyRefreshLayout.measure(0, 0);
swipyRefreshLayout.setRefreshing(true);*/
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
// gankPresenterImpl.getGankDataFromInternet(isTop,mTitle, AppConstant.GAN_DATA_NUM,NOW_PAGE_NUM);
int index = mSoListAdapter.getItemCount();
if (isTop) {
index = 0;
}
mSoPresenter.getSoDataFromInternet(isTop, soType.get(mTitle), index, "new");
}
});
}
示例3: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
/*swipyRefreshLayout.measure(0,0);
swipyRefreshLayout.setRefreshing(true);*/
swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
if (isTop) {
NOW_PAGE = 0;
}
mNewsPresenter.getNewsDataFromInternet(isTop, mType, mId, (int) (NOW_PAGE * 20));
}
});
}
示例4: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {
swipyRefreshLayout = (SwipyRefreshLayout)findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.measure(0,0);
swipyRefreshLayout.setRefreshing(true);
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
boolean isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
// gankPresenterImpl.getGankDataFromInternet(isTop,mTitle, AppConstant.GAN_DATA_NUM,NOW_PAGE_NUM);
soDetailPresenter.getSoDetailDataFromInternet(_id);
}
});
}
示例5: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {
swipyRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.TOP);
swipyRefreshLayout.measure(0, 0);
swipyRefreshLayout.setRefreshing(true);
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
boolean isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
mDetailPresenter.getNewsDetail(postId);
}
});
}
示例6: initEvent
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initEvent() {
mDialog = new SpotsDialog(this);
mTitleCredit.setOnLeftButtonClickListener(new TabTitleView.OnLeftButtonClickListener() {
@Override
public void onClick() {
MyTripsActivity.this.finish();
}
});
mTitleCredit.setOnRightTextViewClickListener(new TabTitleView.OnRightButtonClickListener() {
@Override
public void onClick() {
startActivity(new Intent(MyTripsActivity.this, LastTenTripHistoryActivity.class));
}
});
mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
requestData();
if (mRefreshLayout.isRefreshing())
mRefreshLayout.setRefreshing(false);
}
});
}
示例7: initRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initRefreshLayout() {
mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
if (!CommonUtils.isNetworkAvailable(RechargeHistoryActivity.this)) {
unavailableView.setVisibility(View.VISIBLE);
mRefreshLayout.setRefreshing(false);
return;
}
requestData();
if (mRefreshLayout.isRefreshing())
mRefreshLayout.setRefreshing(false);
}
});
}
示例8: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
Observable.timer(2, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Long>() {
@Override
public void call(Long aLong) {
swipyRefreshLayout.setRefreshing(false);
}
});
loadData(direction == SwipyRefreshLayoutDirection.TOP ? true : false);
}
});
}
示例9: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {
swipyRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.swipyrefreshlayout);
swipyRefreshLayout.setColorSchemeResources(
android.R.color.holo_blue_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_green_light);
swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
Observable.timer(2, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Long>() {
@Override
public void call(Long aLong) {
swipyRefreshLayout.setRefreshing(false);
}
});
webView.loadUrl(url);
loadingView.setVisibility(View.GONE);
}
});
}
示例10: onRefresh
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
/**
* Called when the {@link com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout}
* is in refresh mode. Just for example purpose.
*/
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
Log.d("MainActivity", "Refresh triggered at "
+ (direction == SwipyRefreshLayoutDirection.TOP ? "top" : "bottom"));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//Hide the refresh after 2sec
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
mSwipyRefreshLayout.setRefreshing(false);
}
});
}
}, 2000);
}
示例11: onRefresh
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
/**
* Called when the {@link com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout}
* is in refresh mode. Just for example purpose.
*/
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
Log.d("MainActivity", "Refresh triggered at "
+ (direction == SwipyRefreshLayoutDirection.TOP ? "top" : "bottom"));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//Hide the refresh after 2sec
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
mBinding.swipyrefreshlayout.setRefreshing(false);
}
});
}
}, DISMISS_TIMEOUT);
}
示例12: getItems
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
public void getItems(String query) {
mQuery = query;
mOffset = 0;
mTotal = 0;
mAddedCount = 0;
mRemovedCount = 0;
mLimit = FIRST_LIMIT;
mHandler.removeCallbacks(mRunGetItems);
clearRequest();
showWait(SwipyRefreshLayoutDirection.TOP);
if (mItems != null) {
mItems.clear();
notifyDataSetChanged();
}
mHandler.postDelayed(mRunGetItems, 500);
}
示例13: getItems
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
public void getItems(String query) {
mQuery = query;
mLimit = FIRST_LIMIT;
mHandler.removeCallbacks(mRunGetItems);
clearRequest();
// mLastModify = String.valueOf(System.currentTimeMillis());
mOffset = 0;
mTotal = 0;
if (mItems != null) {
mItems.clear();
notifyDataSetChanged();
}
showWait(SwipyRefreshLayoutDirection.TOP);
mHandler.removeCallbacks(mRunGetItems);
mHandler.postDelayed(mRunGetItems, 500);
}
示例14: setSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
public void setSwipyRefreshLayout(SwipyRefreshLayout swipyRefreshLayout, FloatingActionButton fab) {
BaseListViewScroll onScroll = new BaseListViewScroll();
onScroll.setFloatingActionButton(fab, mListView, this);
setOnScrollListener(onScroll);
mSwipyRefreshLayout = swipyRefreshLayout;
mSwipyRefreshLayout.setEnableBottom(false);
mSwipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
switch (direction) {
case TOP:
notifyDataSetChanged();
break;
case BOTTOM:
mSwipyRefreshLayout.setRefreshing(false);
mToastPopup.show(mContext.getString(R.string.no_more_data), null);
break;
default:
break;
}
}
});
}
示例15: initRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initRefreshLayout() {
mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
requestPoketData();
if (mRefreshLayout.isRefreshing())
mRefreshLayout.setRefreshing(false);
}
});
}