pull/32/head
kunfei 5 years ago
parent d024b60d03
commit d643d022ad
  1. 10
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt
  2. 6
      app/src/main/res/layout/dialog_change_source.xml

@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.SearchView
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import kotlinx.android.synthetic.main.dialog_change_source.* 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) super.onViewCreated(view, savedInstanceState)
tool_bar.inflateMenu(R.menu.search_view) tool_bar.inflateMenu(R.menu.search_view)
tool_bar.title = name tool_bar.title = name
tool_bar.subtitle = author tool_bar.subtitle = getString(R.string.author_show, author)
initRecyclerView()
initSearchView() initSearchView()
} }
private fun initRecyclerView() {
recycler_view.layoutManager = LinearLayoutManager(context)
}
private fun initSearchView() { private fun initSearchView() {
val searchView = tool_bar.menu.findItem(R.id.menu_search).actionView as SearchView val searchView = tool_bar.menu.findItem(R.id.menu_search).actionView as SearchView
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
@ -37,4 +43,6 @@ class ChangeSourceDialog(val name: String, val author: String) : DialogFragment(
}) })
} }
} }

@ -13,5 +13,11 @@
app:fitStatusBar="false" app:fitStatusBar="false"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tool_bar"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save