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 ccbf8e3c9..c74172c37 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 @@ -24,7 +24,7 @@ interface BookDao { @Query("SELECT bookUrl FROM books WHERE `group` = :group") fun observeUrlsByGroup(group: Int): LiveData> - @Query("SELECT bookUrl FROM books WHERE name like '%' || :key || '%' or author like '%' || :key || '%'") + @Query("SELECT * FROM books WHERE name like '%'||:key||'%' or author like '%'||:key||'%'") fun liveDataSearch(key: String): LiveData> @Query("SELECT * FROM books WHERE `name` in (:names)") diff --git a/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt b/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt index 81badc15e..704f37287 100644 --- a/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/SearchKeywordDao.kt @@ -14,7 +14,7 @@ interface SearchKeywordDao { @Query("SELECT * FROM search_keywords ORDER BY lastUseTime DESC") fun liveDataByTime(): LiveData> - @Query("SELECT * FROM search_keywords where word like '%' || :key || '%' ORDER BY usage DESC") + @Query("SELECT * FROM search_keywords where word like '%'||:key||'%' ORDER BY usage DESC") fun liveDataSearch(key: String): LiveData> @Insert(onConflict = OnConflictStrategy.REPLACE) diff --git a/app/src/main/res/layout/activity_book_search.xml b/app/src/main/res/layout/activity_book_search.xml index 246341e4c..8064c107d 100644 --- a/app/src/main/res/layout/activity_book_search.xml +++ b/app/src/main/res/layout/activity_book_search.xml @@ -49,12 +49,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="6dp" - android:text="@string/bookshelf" /> + android:text="@string/bookshelf" + android:visibility="gone" /> + android:layout_height="wrap_content" + android:visibility="gone" />