|
@@ -62,6 +62,7 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
abstract fun transferThumbIntent(): Intent
|
|
|
abstract fun provideReaderSettingDialogFragment(): ReaderSettingDialogFragment
|
|
|
|
|
|
+ open fun insertToRecentDocumentList(filename: String) {}
|
|
|
open fun saveCurrentPageIndex(filename: String, currentPage: Int) {}
|
|
|
open fun loadCurrentPageIndex(filename: String, defaultValue: Int): Int = 0
|
|
|
|
|
@@ -163,6 +164,7 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
viewModel.underLineAttributeLiveData.observe(this, Observer(this::onUnderlineAttributeUpdate))
|
|
|
viewModel.inkAttributeLiveData.observe(this, Observer(this::onInkAttributeUpdate))
|
|
|
viewModel.isOpenedFileLiveData.value?.also { isOpened ->
|
|
|
+ val hasOpened = null != filePath
|
|
|
if (isShowPasswordActivity) return@also
|
|
|
if (isOpened) return@also
|
|
|
val uri = if (intent.action == Intent.ACTION_VIEW) {
|
|
@@ -173,6 +175,9 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
filePath = intent.getStringExtra(KEY_FILE_ABSOLUTE)
|
|
|
Uri.parse(filePath)
|
|
|
}
|
|
|
+ if (!hasOpened && !filePath.isNullOrEmpty()) {
|
|
|
+ insertToRecentDocumentList(filePath as String)
|
|
|
+ }
|
|
|
viewModel.openPdfFile(applicationContext, uri, password, Runnable { requestPassword() }, intent.type)
|
|
|
}
|
|
|
setupRightToolbar()
|