本文整理汇总了Java中com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout类的典型用法代码示例。如果您正苦于以下问题:Java SwipyRefreshLayout类的具体用法?Java SwipyRefreshLayout怎么用?Java SwipyRefreshLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SwipyRefreshLayout类属于com.orangegangsters.github.swipyrefreshlayout.library包,在下文中一共展示了SwipyRefreshLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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: onCreate
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
mType = getIntent().getStringExtra("type");
mUrl = MainActivity.THE_PAGE + "%2F" + mType;
super.onCreate(savedInstanceState);
setTitle(mType+" apk");
setContentView(R.layout.activity_detail);
//Refresh
mRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.detail_refresh);
mRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_dark);
mRefreshLayout.setOnRefreshListener(onRefreshListener);
//List
mLvContent = (ListView) findViewById(R.id.detail_apk_list_lv);
mData = new ArrayList<>();
mAdapter = new ApkListAdapter(this, mData);
mLvContent.setAdapter(mAdapter);
mHandler = new Handler();
mLvContent.setOnItemClickListener(this);
//Do initial request
update(mUrl);
}
示例9: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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);
}
});
}
示例10: initSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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);
}
});
}
示例11: setSwipyRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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;
}
}
});
}
示例12: waitSwipyRefresh
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
public static void waitSwipyRefresh() {
w(3000);
onView(withId(R.id.swipe_refresh_layout)).perform(new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return ViewMatchers.isAssignableFrom(SwipyRefreshLayout.class);
}
@Override
public String getDescription() {
return "get text from edit text view:";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
SwipyRefreshLayout swipy = (SwipyRefreshLayout) view;
while (swipy.isRefreshing()) {
uiController.loopMainThreadUntilIdle();
uiController.loopMainThreadForAtLeast(1000);
}
}
});
}
示例13: initRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
private void initRefreshLayout() {
mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
requestPoketData();
if (mRefreshLayout.isRefreshing())
mRefreshLayout.setRefreshing(false);
}
});
}
示例14: initRefreshLayout
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
private void initRefreshLayout() {
// mRefreshLayout.setLoadMore(true);
// mRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
// @Override
// public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
// requestMassage();
// mRecyclerMassage.scrollToPosition(0);
// mRefreshLayout.finishRefresh();
// }
//
// @Override
// public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {
// requestMassage();//实际活动较少,上下拉刷新不需要分页
// mRefreshLayout.finishRefreshLoadMore();
// }
//
// });
mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
requestMassage();
if (mRefreshLayout.isRefreshing())
mRefreshLayout.setRefreshing(false);
}
});
}
示例15: setRefreshing
import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
@BindingAdapter("app:isRefreshing")
public static void setRefreshing(final SwipyRefreshLayout swipyRefreshLayout, final Boolean isRefreshing) {
swipyRefreshLayout.post(new Runnable() {
@Override
public void run() {
swipyRefreshLayout.setRefreshing(isRefreshing);
}
});
}