diff --git a/app/src/main/java/com/kunfei/bookshelf/DbHelper.java b/app/src/main/java/com/kunfei/bookshelf/DbHelper.java index 240be5a3db..9265cfcf1a 100644 --- a/app/src/main/java/com/kunfei/bookshelf/DbHelper.java +++ b/app/src/main/java/com/kunfei/bookshelf/DbHelper.java @@ -54,7 +54,7 @@ public static SQLiteDatabase getDb() { return getInstance().db; } - public class DaoOpenHelper extends DaoMaster.OpenHelper { + public static class DaoOpenHelper extends DaoMaster.OpenHelper { DaoOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) { super(context, name, factory); } diff --git a/app/src/main/java/com/kunfei/bookshelf/base/BaseModelImpl.java b/app/src/main/java/com/kunfei/bookshelf/base/BaseModelImpl.java index b7e0439ac2..6dcd201f22 100644 --- a/app/src/main/java/com/kunfei/bookshelf/base/BaseModelImpl.java +++ b/app/src/main/java/com/kunfei/bookshelf/base/BaseModelImpl.java @@ -191,7 +191,7 @@ public void onPageFinished(WebView view, String url) { }); } - private class Web { + private static class Web { private String content; private String js = "document.documentElement.outerHTML"; diff --git a/app/src/main/java/com/kunfei/bookshelf/bean/BookKindBean.java b/app/src/main/java/com/kunfei/bookshelf/bean/BookKindBean.java index eb4e5b2632..238e6de9bd 100644 --- a/app/src/main/java/com/kunfei/bookshelf/bean/BookKindBean.java +++ b/app/src/main/java/com/kunfei/bookshelf/bean/BookKindBean.java @@ -16,7 +16,7 @@ public BookKindBean(String kindS) { for (String kind : kindS.split("[,|\n]")) { if (StringUtils.isContainNumber(kind) && TextUtils.isEmpty(wordsS)) { if (StringUtils.isNumeric(kind)) { - int words = Integer.valueOf(kind); + int words = Integer.parseInt(kind); if (words > 0) { wordsS = words + "字"; if (words > 10000) { diff --git a/app/src/main/java/com/kunfei/bookshelf/bean/BookShelfBean.java b/app/src/main/java/com/kunfei/bookshelf/bean/BookShelfBean.java index 2e916b9c81..11097659b4 100644 --- a/app/src/main/java/com/kunfei/bookshelf/bean/BookShelfBean.java +++ b/app/src/main/java/com/kunfei/bookshelf/bean/BookShelfBean.java @@ -263,7 +263,7 @@ public void setLastChapterName(String lastChapterName) { public int getUnreadChapterNum() { int num = getChapterListSize() - getDurChapter() - 1; - return num < 0 ? 0 : num; + return Math.max(num, 0); } public int getChapterListSize() { diff --git a/app/src/main/java/com/kunfei/bookshelf/widget/HorizontalListView.java b/app/src/main/java/com/kunfei/bookshelf/widget/HorizontalListView.java index 1a9e3dd5f4..9d01b7c83e 100644 --- a/app/src/main/java/com/kunfei/bookshelf/widget/HorizontalListView.java +++ b/app/src/main/java/com/kunfei/bookshelf/widget/HorizontalListView.java @@ -148,8 +148,7 @@ protected synchronized void onLayout(boolean changed, int left, int top, int rig } if(mScroller.computeScrollOffset()){ - int scrollx = mScroller.getCurrX(); - mNextX = scrollx; + mNextX = mScroller.getCurrX(); } if(mNextX <= 0){ diff --git a/app/src/main/java/com/kunfei/bookshelf/widget/page/PageLoader.java b/app/src/main/java/com/kunfei/bookshelf/widget/page/PageLoader.java index 3fc55ef660..3f8c59290e 100644 --- a/app/src/main/java/com/kunfei/bookshelf/widget/page/PageLoader.java +++ b/app/src/main/java/com/kunfei/bookshelf/widget/page/PageLoader.java @@ -1775,7 +1775,7 @@ private ChapterContainer nextChapter() { /*****************************************interface*****************************************/ - class ChapterContainer { + static class ChapterContainer { TxtChapter txtChapter; }