pull/32/head
gedoor 6 years ago
parent 9a2907ea0f
commit 81118074be
  1. 10
      app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt

@ -1,9 +1,11 @@
package io.legado.app.ui.sourceedit package io.legado.app.ui.sourceedit
import android.os.Bundle import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.BaseActivity import io.legado.app.base.BaseActivity
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_source_edit.*
class SourceEditActivity : BaseActivity<SourceEditViewModel>() { class SourceEditActivity : BaseActivity<SourceEditViewModel>() {
override val viewModel: SourceEditViewModel override val viewModel: SourceEditViewModel
@ -11,10 +13,16 @@ class SourceEditActivity : BaseActivity<SourceEditViewModel>() {
override val layoutID: Int override val layoutID: Int
get() = R.layout.activity_source_edit get() = R.layout.activity_source_edit
val adapter = SourceEditAdapter()
override fun onViewModelCreated(viewModel: SourceEditViewModel, savedInstanceState: Bundle?) { override fun onViewModelCreated(viewModel: SourceEditViewModel, savedInstanceState: Bundle?) {
val sourceID = intent.getStringExtra("data") val sourceID = intent.getStringExtra("data")
sourceID?.let { viewModel.setBookSource(sourceID)} sourceID?.let { viewModel.setBookSource(sourceID)}
initRecyclerView()
} }
fun initRecyclerView() {
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
}
} }
Loading…
Cancel
Save