Skip to content

Commit

Permalink
增加下拉同步書架功能.(不乾净
Browse files Browse the repository at this point in the history
  • Loading branch information
zths committed Aug 3, 2017
1 parent f9553c7 commit 973a93c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public void initToolBar() {
mCommonToolbar.setLogo(R.mipmap.logo);
setTitle("");
}
public void pullSyncBookShelf(){
mPresenter.syncBookShelf();
}

@Override
public void initDatas() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,27 @@ public void delete() {
@Override
public void onRefresh() {
super.onRefresh();
StackTraceElement stack[] = (new Throwable()).getStackTrace();


boolean hasRefBookShelfInCallStack = false;
boolean isMRefresh = false;
for (int i = 0; i < stack.length; i++) {
StackTraceElement ste = stack[i];
if (ste.getMethodName().equals("pullSyncBookShelf")) {
hasRefBookShelfInCallStack = true;
}
if (ste.getMethodName().equals("onAnimationEnd") && ste.getFileName().equals("SwipeRefreshLayout.java")) {
isMRefresh = true;
}
}

if (!hasRefBookShelfInCallStack && isMRefresh) {
((MainActivity) activity).pullSyncBookShelf();
return;
}


gone(llBatchManagement);
List<Recommend.RecommendBooks> data = CollectionsManager.getInstance().getCollectionListBySort();
mAdapter.clear();
Expand Down

0 comments on commit 973a93c

Please sign in to comment.