From 81118074bee254123647dfbc7a051b53b4720263 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 7 Jun 2019 18:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/sourceedit/SourceEditActivity.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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