|
|
@ -38,21 +38,17 @@ class FileAssociationViewModel(application: Application) : BaseViewModel(applica |
|
|
|
LocalBook.importFile(uri.path.toString()) |
|
|
|
LocalBook.importFile(uri.path.toString()) |
|
|
|
toast("添加本地文件成功${uri.path}") |
|
|
|
toast("添加本地文件成功${uri.path}") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return null |
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
else{ |
|
|
|
|
|
|
|
toast("文件不存在") |
|
|
|
toast("文件不存在") |
|
|
|
return null |
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
url = "yuedu://${scheme}/importonline?src=${uri.path}" |
|
|
|
url = "yuedu://${scheme}/importonline?src=${uri.path}" |
|
|
|
} |
|
|
|
} else if (uri.scheme == "yuedu") { |
|
|
|
else if (uri.scheme == "yuedu"){ |
|
|
|
|
|
|
|
url = uri.toString() |
|
|
|
url = uri.toString() |
|
|
|
} |
|
|
|
} else { |
|
|
|
else{ |
|
|
|
|
|
|
|
url = "yuedu://booksource/importonline?src=${uri.path}" |
|
|
|
url = "yuedu://booksource/importonline?src=${uri.path}" |
|
|
|
} |
|
|
|
} |
|
|
|
val data = Uri.parse(url) |
|
|
|
val data = Uri.parse(url) |
|
|
|