From d0f37022482b3d8b031c610d84741c2d8a19d6fd Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 13 Aug 2019 20:46:13 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/dao/BookDao.kt | 3 +++ .../io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/app/src/main/java/io/legado/app/data/dao/BookDao.kt b/app/src/main/java/io/legado/app/data/dao/BookDao.kt index 58bd7a36c..f1afa562e 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookDao.kt @@ -42,6 +42,9 @@ interface BookDao { @Query("SELECT * FROM books ORDER BY durChapterTime DESC limit 0,10") fun recentRead(): DataSource.Factory + @Query("SELECT * FROM books ORDER BY durChapterTime DESC limit 0,10") + fun getRecentRead(): DataSource.Factory + @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(vararg books: Book) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt index 1bb9a3b64..99f495040 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt @@ -20,4 +20,12 @@ class BookshelfViewModel(application: Application) : BaseViewModel(application) } } + + fun upChapterList() { + execute { + App.db.bookDao().getRecentRead().map { + + } + } + } }