From ca7091a7e6fb62e0bde4df89d80e9cd87592a2c1 Mon Sep 17 00:00:00 2001
From: zlj <390057892@qq.com>
Date: Wed, 6 Nov 2019 18:01:05 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/src/main/assets/litepal.xml | 2 ++
.../novel/read/activity/NovelReadActivity.kt | 20 +++++++++++--------
.../novel/read/model/db/BookSignTable.java | 17 ++++++++++++++++
.../novel/read/model/db/ChapterInfoBean.java | 4 ----
.../com/novel/read/model/db/CollBookBean.java | 1 -
.../novel/read/model/db/DownloadTaskBean.java | 5 -----
6 files changed, 31 insertions(+), 18 deletions(-)
create mode 100644 app/src/main/java/com/novel/read/model/db/BookSignTable.java
diff --git a/app/src/main/assets/litepal.xml b/app/src/main/assets/litepal.xml
index 9729b78..91882d1 100644
--- a/app/src/main/assets/litepal.xml
+++ b/app/src/main/assets/litepal.xml
@@ -17,5 +17,7 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/novel/read/activity/NovelReadActivity.kt b/app/src/main/java/com/novel/read/activity/NovelReadActivity.kt
index e2f0217..01024fa 100644
--- a/app/src/main/java/com/novel/read/activity/NovelReadActivity.kt
+++ b/app/src/main/java/com/novel/read/activity/NovelReadActivity.kt
@@ -347,8 +347,8 @@ class NovelReadActivity : NovelBaseActivity(), DownloadService.OnDownloadListene
)
) { _, which ->
when (which) {
- 0 //50章
- -> {
+ 0 -> {
+ //50章
val last = currentChapter + 50
if (last > mCollBook!!.bookChapters.size) {
downLoadCache(mCollBook!!.bookChapters, mCollBook!!.bookChapters.size)
@@ -356,16 +356,15 @@ class NovelReadActivity : NovelBaseActivity(), DownloadService.OnDownloadListene
downLoadCache(mCollBook!!.bookChapters, last)
}
}
- 1 //后面所有
- -> {
+ 1 -> {
+ //后面所有
val lastBeans = ArrayList()
for (i in currentChapter until mCollBook!!.bookChapters.size) {
lastBeans.add(mCollBook!!.bookChapters[i])
}
downLoadCache(lastBeans, mCollBook!!.bookChapters.size - currentChapter)
}
- 2 //所有
- -> downLoadCache(mCollBook!!.bookChapters, mCollBook!!.bookChapters.size)
+ 2 -> downLoadCache(mCollBook!!.bookChapters, mCollBook!!.bookChapters.size) //所有
else -> {
}
}
@@ -391,12 +390,17 @@ class NovelReadActivity : NovelBaseActivity(), DownloadService.OnDownloadListene
tvBookReadMode.text = resources.getString(R.string.book_read_mode_day)
val drawable = ContextCompat.getDrawable(this, R.drawable.ic_read_menu_moring)
tvBookReadMode.setCompoundDrawablesWithIntrinsicBounds(null, drawable, null, null)
- cl_layout.setBackgroundColor(ContextCompat.getColor(this,R.color.nb_read_bg_night))
+ cl_layout.setBackgroundColor(ContextCompat.getColor(this, R.color.nb_read_bg_night))
} else {
tvBookReadMode.text = resources.getString(R.string.book_read_mode_day)
val drawable = ContextCompat.getDrawable(this, R.drawable.ic_read_menu_night)
tvBookReadMode.setCompoundDrawablesWithIntrinsicBounds(null, drawable, null, null)
- cl_layout.setBackgroundColor(ContextCompat.getColor(this,ReadSettingManager.getInstance().pageStyle.bgColor))
+ cl_layout.setBackgroundColor(
+ ContextCompat.getColor(
+ this,
+ ReadSettingManager.getInstance().pageStyle.bgColor
+ )
+ )
}
}
diff --git a/app/src/main/java/com/novel/read/model/db/BookSignTable.java b/app/src/main/java/com/novel/read/model/db/BookSignTable.java
new file mode 100644
index 0000000..418016c
--- /dev/null
+++ b/app/src/main/java/com/novel/read/model/db/BookSignTable.java
@@ -0,0 +1,17 @@
+package com.novel.read.model.db;
+
+import org.litepal.crud.LitePalSupport;
+
+import java.io.Serializable;
+
+/**
+ * create by zlj on 2019/11/6
+ * describe: 书签数据库
+ */
+public class BookSignTable extends LitePalSupport implements Serializable {
+
+ private String bookId;
+ private String content;
+ private long saveTime;
+
+}
diff --git a/app/src/main/java/com/novel/read/model/db/ChapterInfoBean.java b/app/src/main/java/com/novel/read/model/db/ChapterInfoBean.java
index 13f87c5..76ffd48 100644
--- a/app/src/main/java/com/novel/read/model/db/ChapterInfoBean.java
+++ b/app/src/main/java/com/novel/read/model/db/ChapterInfoBean.java
@@ -1,9 +1,5 @@
package com.novel.read.model.db;
-/**
- * Created by newbiechen on 17-5-10.
- */
-
public class ChapterInfoBean {
/**
* title : 第一章 他叫白小纯
diff --git a/app/src/main/java/com/novel/read/model/db/CollBookBean.java b/app/src/main/java/com/novel/read/model/db/CollBookBean.java
index 2a7e54c..25d336b 100644
--- a/app/src/main/java/com/novel/read/model/db/CollBookBean.java
+++ b/app/src/main/java/com/novel/read/model/db/CollBookBean.java
@@ -10,7 +10,6 @@ import java.util.ArrayList;
import java.util.List;
/**
- * Created by newbiechen on 17-5-8.
* 收藏的书籍
*/
public class CollBookBean extends LitePalSupport implements Serializable {
diff --git a/app/src/main/java/com/novel/read/model/db/DownloadTaskBean.java b/app/src/main/java/com/novel/read/model/db/DownloadTaskBean.java
index 1560006..516223b 100644
--- a/app/src/main/java/com/novel/read/model/db/DownloadTaskBean.java
+++ b/app/src/main/java/com/novel/read/model/db/DownloadTaskBean.java
@@ -70,11 +70,6 @@ public class DownloadTaskBean extends LitePalSupport {
public List getBookChapterList() {
if (bookChapterList == null) {
-
-// BookChapterBeanDao targetDao = daoSession.getBookChapterBeanDao();
-// List bookChapterListNew = targetDao
-// ._queryDownloadTaskBean_BookChapterList(taskName);
-
List bookChapterListNew = LitePal
.where("taskName=?", taskName).find(BookChapterBean.class);