From cd01963530eed56d5ff825711025bfe9528c7650 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 25 Jul 2019 20:35:37 +0800 Subject: [PATCH] up --- .../app/ui/main/bookshelf/BookshelfFragment.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 6118f90af..41a806dea 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -3,6 +3,7 @@ package io.legado.app.ui.main.bookshelf import android.os.Bundle import android.view.Menu import android.view.View +import androidx.appcompat.widget.SearchView import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import androidx.paging.LivePagedListBuilder @@ -26,7 +27,8 @@ import kotlinx.coroutines.launch import org.jetbrains.anko.startActivity import org.jetbrains.anko.textColor -class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf), BookGroupAdapter.CallBack { +class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf), SearchView.OnQueryTextListener, + BookGroupAdapter.CallBack { private lateinit var bookshelfAdapter: BookshelfAdapter private lateinit var bookGroupAdapter: BookGroupAdapter @@ -51,6 +53,7 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf), BookGroupAd search_view.isSubmitButtonEnabled = true search_view.queryHint = getString(R.string.search_book_key) search_view.clearFocus() + search_view.setOnQueryTextListener(this) } private fun initRecyclerView() { @@ -106,4 +109,12 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf), BookGroupAd } } + override fun onQueryTextSubmit(query: String?): Boolean { + return false + } + + override fun onQueryTextChange(newText: String?): Boolean { + return false + } + } \ No newline at end of file