|
@@ -17,6 +17,7 @@ abstract class CopyFileActivity : KdanBaseActivity(), ReadModuleKoinComponent {
|
|
abstract fun getKdanPdfReaderFolder(): File
|
|
abstract fun getKdanPdfReaderFolder(): File
|
|
abstract fun provideReaderActivityIntent(filePath: String?): Intent
|
|
abstract fun provideReaderActivityIntent(filePath: String?): Intent
|
|
open fun hasPermissionToAccessExternalStorage(): Boolean = true
|
|
open fun hasPermissionToAccessExternalStorage(): Boolean = true
|
|
|
|
+ open fun onFileCopyComplete(callback: () -> Unit) = callback.invoke()
|
|
|
|
|
|
companion object {
|
|
companion object {
|
|
const val KEY_FILE_ABSOLUTE_PATH = "file_absolute_path"
|
|
const val KEY_FILE_ABSOLUTE_PATH = "file_absolute_path"
|
|
@@ -47,7 +48,9 @@ abstract class CopyFileActivity : KdanBaseActivity(), ReadModuleKoinComponent {
|
|
if (null == event) return
|
|
if (null == event) return
|
|
when (event) {
|
|
when (event) {
|
|
is CopyFileViewModel.Event.Success -> {
|
|
is CopyFileViewModel.Event.Success -> {
|
|
- startReaderActivity(event.filePath)
|
|
|
|
|
|
+ onFileCopyComplete {
|
|
|
|
+ startReaderActivity(event.filePath)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
is CopyFileViewModel.Event.Failed -> {
|
|
is CopyFileViewModel.Event.Failed -> {
|
|
event.e.printStackTrace()
|
|
event.e.printStackTrace()
|