diff --git a/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt index f896e386a..55bfb3d0a 100644 --- a/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt @@ -1,9 +1,11 @@ package io.legado.app.ui.sourceedit import android.os.Bundle +import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseActivity import io.legado.app.utils.getViewModel +import kotlinx.android.synthetic.main.activity_source_edit.* class SourceEditActivity : BaseActivity() { override val viewModel: SourceEditViewModel @@ -11,10 +13,16 @@ class SourceEditActivity : BaseActivity() { override val layoutID: Int get() = R.layout.activity_source_edit + val adapter = SourceEditAdapter() + override fun onViewModelCreated(viewModel: SourceEditViewModel, savedInstanceState: Bundle?) { val sourceID = intent.getStringExtra("data") sourceID?.let { viewModel.setBookSource(sourceID)} + initRecyclerView() } - + fun initRecyclerView() { + recycler_view.layoutManager = LinearLayoutManager(this) + recycler_view.adapter = adapter + } } \ No newline at end of file