From c0441217c67d8664f783a9d6878172b4eed288e9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 29 Jan 2020 19:53:42 +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 | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) 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 8cbce52f8..81c2df2ea 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 @@ -1,19 +1,50 @@ package io.legado.app.ui.importbook +import android.app.Activity +import android.content.Intent import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.utils.getViewModel class ImportBookActivity : VMBaseActivity(R.layout.activity_import_book) { + private val requestCodeSelectFolder = 342 override val viewModel: ImportBookViewModel get() = getViewModel(ImportBookViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { + initView() + } + + override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.import_book, menu) + return super.onCompatCreateOptionsMenu(menu) + } + + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.menu_select_folder -> { + } + } + return super.onCompatOptionsItemSelected(item) + } + + private fun initView() { + + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + when (requestCode) { + requestCodeSelectFolder -> if (resultCode == Activity.RESULT_OK) { + } + } } } \ No newline at end of file