|
|
@ -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( |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |