diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt index 2649ecb7c..df376b041 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.SearchView import androidx.fragment.app.DialogFragment +import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import kotlinx.android.synthetic.main.dialog_change_source.* @@ -20,10 +21,15 @@ class ChangeSourceDialog(val name: String, val author: String) : DialogFragment( super.onViewCreated(view, savedInstanceState) tool_bar.inflateMenu(R.menu.search_view) tool_bar.title = name - tool_bar.subtitle = author + tool_bar.subtitle = getString(R.string.author_show, author) + initRecyclerView() initSearchView() } + private fun initRecyclerView() { + recycler_view.layoutManager = LinearLayoutManager(context) + } + private fun initSearchView() { val searchView = tool_bar.menu.findItem(R.id.menu_search).actionView as SearchView searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { @@ -37,4 +43,6 @@ class ChangeSourceDialog(val name: String, val author: String) : DialogFragment( }) } + + } \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_change_source.xml b/app/src/main/res/layout/dialog_change_source.xml index 68db3890e..e43f8cdae 100644 --- a/app/src/main/res/layout/dialog_change_source.xml +++ b/app/src/main/res/layout/dialog_change_source.xml @@ -13,5 +13,11 @@ app:fitStatusBar="false" app:layout_constraintTop_toTopOf="parent" /> + \ No newline at end of file