From 516432b28c7a66204b274754d9372497f07af3e5 Mon Sep 17 00:00:00 2001 From: mwang <8205347@qq.com> Date: Wed, 19 Jun 2019 00:44:15 +0800 Subject: [PATCH] shelf change --- .../com/novelbook/android/Fragments/CatalogFragment.java | 8 ++++---- zhuike/src/main/java/com/novelbook/android/db/Novel.java | 6 +++--- .../main/java/com/novelbook/android/utils/BookUtil.java | 3 ++- .../java/com/novelbook/android/utils/PageFactory.java | 3 ++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java b/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java index e5c164c..15a4a9d 100644 --- a/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java +++ b/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java @@ -181,17 +181,17 @@ public class CatalogFragment extends BasicFragment implements MarkActivity.Sortc int maxSlept =NetUtil.isNetworkConnected()?250 :100; int slepttime = 0; - while ( slepttime < maxSlept && ( pageFactory.isReadingCatalogs() || pageFactory.getChapters().size() == 0)) { + while ( slepttime < maxSlept*50 && ( pageFactory.isReadingCatalogs() || pageFactory.getChapters().size() == 0)) { try { - Log.d(TAG, String .format("prepare book: to open book cate to sleep %s" , 50)); + Log.d(TAG, String .format("prepare book: to open book cate to sleep %s,pageFactory.getChapters().size() %s " , 50,pageFactory.getChapters().size())); sleep(50); - slepttime++; + slepttime+=50; } catch (InterruptedException e) { e.printStackTrace(); } } - Log.d(TAG, String .format("prepare book:to open book cate slept %s" , slepttime*50)); + Log.d(TAG, String .format("prepare book:to open book cate slept %s秒" , slepttime/1000)); /* if ( !pageFactory.isReadingCatalogs() && pageFactory.getChapters().size() == 0) { handler.sendEmptyMessage(2); diff --git a/zhuike/src/main/java/com/novelbook/android/db/Novel.java b/zhuike/src/main/java/com/novelbook/android/db/Novel.java index 1265795..8dae022 100644 --- a/zhuike/src/main/java/com/novelbook/android/db/Novel.java +++ b/zhuike/src/main/java/com/novelbook/android/db/Novel.java @@ -332,7 +332,7 @@ public void testUpdate(){ /* if(lastUpdateTime > nv.lastVisit && lastUpdateTime > nv.lastUpdateTime){ isUpdated =true; }*/ - isUpdated = lastUpdateTime > nv.lastVisit && lastUpdateTime > nv.lastUpdateTime; + isUpdated = lastUpdateTime > nv.lastVisit || lastUpdateTime > nv.lastUpdateTime; Log.d("Novel", String.format("book %s server lastUpdateTime %s, local lastupdatetime %s, local lastvist %s" + "is updated %s,diff1 %s,diff2 %s " ,name ,lastUpdateTime,nv.lastUpdateTime,nv.lastVisit,isUpdated, @@ -340,9 +340,9 @@ public void testUpdate(){ lastUpdateTime - nv.lastUpdateTime ) ); - isUpdated = isUpdated && !(!TextUtils.isEmpty(chapterName) && !TextUtils.isEmpty(nv.chapterName) && (chapterName.equals(nv.chapterName) || chapterName.equals(nv.lastReadChapt))); + // isUpdated = isUpdated && !(!TextUtils.isEmpty(chapterName) && !TextUtils.isEmpty(nv.chapterName) && (chapterName.equals(nv.chapterName) || chapterName.equals(nv.lastReadChapt))); - Log.d("Novel", String.format( " isupdated %s, server lastUpdateTime ,server chaptername %s,chaptername %s,lastreadchapt %s" ,isUpdated,chapterName,nv.chapterName,nv.lastReadChapt ) ); + // Log.d("Novel", String.format( " isupdated %s, server lastUpdateTime ,server chaptername %s,chaptername %s,lastreadchapt %s" ,isUpdated,chapterName,nv.chapterName,nv.lastReadChapt ) ); if(!isUpdated){ setToDefault("isUpdated"); diff --git a/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java b/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java index e7b2ec6..16f1b6f 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java @@ -384,9 +384,10 @@ public class BookUtil { readChaptersAsync(); }else { + mMuluStatus = MuluStatus.isDone; handler.sendEmptyMessage(MSG_READCHAPTER_SUCCESS); Log.d(TAG,String.format("prepare book loadChapts----end download %s 目录, 目录数量 %s, cost %s", mNovel.getName() , mChapters.size(), new Date().getTime() -startTime )); - mMuluStatus = MuluStatus.isDone; + Log.d(TAG, String.format("prepare book %s 章节信息完成.",mNovel.getName()) ); } diff --git a/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java b/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java index db85ec0..0b11d49 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java @@ -939,9 +939,10 @@ private void hideSysUI(){ // showStatusAd((int) adHeight, (int) adY); // Log.d(TAG, "loadBannerAd: draw status, AD is requested, mStatus:" +mStatus); } - + Log.d(TAG, "drawStatus: mStatus is " +mStatus); if (mStatus==Status.OPENING ) { String url = mBookUtil.getChapter(getNovel().getLastReadChapt()).getChapterUrl(); + Log.d(TAG, "drawStatus: url is " +url); if(!TextUtils.isEmpty(url)) { if(url.length()>100) url =url.substring(0,100);