pull/34/head
kunfei 5 years ago
parent bab5d1382c
commit 288cf8603f
  1. 2
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt
  2. 21
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt

@ -11,9 +11,9 @@ class RssSourceEditActivity :
override val viewModel: RssSourceEditViewModel
get() = getViewModel(RssSourceEditViewModel::class.java)
override fun onActivityCreated(savedInstanceState: Bundle?) {
}
}

@ -1,6 +1,7 @@
package io.legado.app.ui.rss.source.manage
import android.os.Bundle
import androidx.appcompat.widget.SearchView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.ItemTouchHelper
@ -10,8 +11,10 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.RssSource
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_rss_source.*
import kotlinx.android.synthetic.main.view_search.*
class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_rss_source),
@ -24,6 +27,7 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
override fun onActivityCreated(savedInstanceState: Bundle?) {
initRecyclerView()
initSearchView()
}
private fun initRecyclerView() {
@ -43,6 +47,23 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
ItemTouchHelper(itemTouchCallback).attachToRecyclerView(recycler_view)
}
private fun initSearchView() {
ATH.setTint(search_view, primaryTextColor)
search_view.onActionViewExpanded()
search_view.queryHint = getString(R.string.search_book_source)
search_view.clearFocus()
search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean {
return false
}
override fun onQueryTextChange(newText: String?): Boolean {
return false
}
})
}
override fun del(source: RssSource) {
}

Loading…
Cancel
Save