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