From 9a6d5e06efabc1eb678eeaddc67faff53028a05f Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 8 Aug 2019 21:46:50 +0800 Subject: [PATCH] up --- .../java/io/legado/app/data/AppDatabase.kt | 2 +- .../io/legado/app/data/entities/Bookmark.kt | 21 +++++++++++++++++++ .../app/ui/chapterlist/BookmarkAdapter.kt | 2 ++ .../app/ui/chapterlist/ChapterListAdapter.kt | 2 ++ app/src/main/res/layout/item_bookmark.xml | 7 +++++++ app/src/main/res/layout/item_chapter_list.xml | 7 +++++++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/io/legado/app/data/entities/Bookmark.kt create mode 100644 app/src/main/java/io/legado/app/ui/chapterlist/BookmarkAdapter.kt create mode 100644 app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt create mode 100644 app/src/main/res/layout/item_bookmark.xml create mode 100644 app/src/main/res/layout/item_chapter_list.xml diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt index 630763064..5fdff03e0 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -12,7 +12,7 @@ import io.legado.app.data.entities.* @Database( entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class, ReplaceRule::class, SearchBook::class, - SearchKeyword::class, SourceCookie::class, RssSource::class], + SearchKeyword::class, SourceCookie::class, RssSource::class, Bookmark::class], version = 1, exportSchema = true ) diff --git a/app/src/main/java/io/legado/app/data/entities/Bookmark.kt b/app/src/main/java/io/legado/app/data/entities/Bookmark.kt new file mode 100644 index 000000000..c1f638137 --- /dev/null +++ b/app/src/main/java/io/legado/app/data/entities/Bookmark.kt @@ -0,0 +1,21 @@ +package io.legado.app.data.entities + +import android.os.Parcelable +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey +import kotlinx.android.parcel.Parcelize + +@Parcelize +@Entity(tableName = "bookmarks", indices = [(Index(value = ["bookUrl"], unique = true))]) +data class Bookmark( + @PrimaryKey + var time: Long = System.currentTimeMillis(), + var bookUrl: String = "", + var bookName: String = "", + var chapterName: String = "", + var chapterIndex: Int = 0, + var pageIndex: Int = 0, + var content: String = "" + +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/chapterlist/BookmarkAdapter.kt b/app/src/main/java/io/legado/app/ui/chapterlist/BookmarkAdapter.kt new file mode 100644 index 000000000..8fe0ecbe6 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/chapterlist/BookmarkAdapter.kt @@ -0,0 +1,2 @@ +package io.legado.app.ui.chapterlist + diff --git a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt new file mode 100644 index 000000000..8fe0ecbe6 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt @@ -0,0 +1,2 @@ +package io.legado.app.ui.chapterlist + diff --git a/app/src/main/res/layout/item_bookmark.xml b/app/src/main/res/layout/item_bookmark.xml new file mode 100644 index 000000000..d829e291c --- /dev/null +++ b/app/src/main/res/layout/item_bookmark.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_chapter_list.xml b/app/src/main/res/layout/item_chapter_list.xml new file mode 100644 index 000000000..d829e291c --- /dev/null +++ b/app/src/main/res/layout/item_chapter_list.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file