From f22aa549d9a94c47f14f2901241c1455352abfc2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 22 Dec 2019 21:37:16 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/download/DownloadActivity.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/download/DownloadActivity.kt b/app/src/main/java/io/legado/app/ui/download/DownloadActivity.kt index 3f551da51..18e6ce0c4 100644 --- a/app/src/main/java/io/legado/app/ui/download/DownloadActivity.kt +++ b/app/src/main/java/io/legado/app/ui/download/DownloadActivity.kt @@ -1,18 +1,23 @@ package io.legado.app.ui.download import android.os.Bundle +import androidx.lifecycle.LiveData +import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseActivity +import io.legado.app.data.entities.Book import kotlinx.android.synthetic.main.activity_download.* class DownloadActivity : BaseActivity(R.layout.activity_download) { lateinit var adapter: DownloadAdapter + private var bookshelfLiveData: LiveData>? = null override fun onActivityCreated(savedInstanceState: Bundle?) { initRecyclerView() + initLiveData() } private fun initRecyclerView() { @@ -21,4 +26,10 @@ class DownloadActivity : BaseActivity(R.layout.activity_download) { recycler_view.adapter = adapter } + private fun initLiveData() { + bookshelfLiveData?.removeObservers(this) + bookshelfLiveData?.observe(this, Observer { + + }) + } } \ No newline at end of file