mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-25 02:48:54 +01:00
Format code
This commit is contained in:
parent
56698e12ce
commit
e1a767dc5c
2 changed files with 19 additions and 16 deletions
|
@ -26,21 +26,24 @@ class DownloadChannelHandler(activity: Activity) :
|
|||
}
|
||||
|
||||
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
|
||||
if (call.method == "downloadUrl") {
|
||||
try {
|
||||
downloadUrl(
|
||||
call.argument("url")!!,
|
||||
call.argument("headers"),
|
||||
call.argument("mimeType"),
|
||||
call.argument("filename")!!,
|
||||
call.argument("shouldNotify"),
|
||||
result
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
result.error("systemException", e.toString(), null)
|
||||
when (call.method) {
|
||||
"downloadUrl" -> {
|
||||
try {
|
||||
downloadUrl(
|
||||
call.argument("url")!!,
|
||||
call.argument("headers"),
|
||||
call.argument("mimeType"),
|
||||
call.argument("filename")!!,
|
||||
call.argument("shouldNotify"),
|
||||
result
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
result.error("systemException", e.toString(), null)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
result.notImplemented()
|
||||
}
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.nkming.nc_photos
|
|||
|
||||
interface K {
|
||||
companion object {
|
||||
const val DOWNLOAD_NOTIFICATION_ID_MIN = 1000;
|
||||
const val DOWNLOAD_NOTIFICATION_ID_MAX = 2000;
|
||||
const val DOWNLOAD_NOTIFICATION_ID_MIN = 1000
|
||||
const val DOWNLOAD_NOTIFICATION_ID_MAX = 2000
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue