From 943186974c28ae5ec91779ebfe15db11bd823eaf Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 30 Jan 2020 16:46:59 +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 --- .../app/ui/importbook/ImportBookActivity.kt | 17 +++++++++++++++++ .../main/res/layout/activity_import_book.xml | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt index e1586bda4..b2b5cdca9 100644 --- a/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt @@ -14,6 +14,7 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.help.AppConfig import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_import_book.* +import org.jetbrains.anko.sdk27.listeners.onClick import java.io.File @@ -29,6 +30,7 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity override fun onActivityCreated(savedInstanceState: Bundle?) { initView() + initEvent() upRootDoc() } @@ -50,6 +52,21 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity recycler_view.adapter = importBookAdapter } + private fun initEvent() { + tv_go_back.onClick { + if (subDirs.isNotEmpty()) { + subDirs.removeAt(subDirs.lastIndex) + upPath() + } + } + btn_add_book.onClick { + + } + btn_delete.onClick { + + } + } + private fun upRootDoc() { AppConfig.importBookPath?.let { val rootUri = Uri.parse(it) diff --git a/app/src/main/res/layout/activity_import_book.xml b/app/src/main/res/layout/activity_import_book.xml index 820fef31d..4167ab86f 100644 --- a/app/src/main/res/layout/activity_import_book.xml +++ b/app/src/main/res/layout/activity_import_book.xml @@ -68,7 +68,7 @@ tools:ignore="RtlHardcoded,RtlSymmetry">