Format code

This commit is contained in:
Ming Ming 2021-10-02 15:53:40 +08:00
parent 56698e12ce
commit e1a767dc5c
2 changed files with 19 additions and 16 deletions

View file

@ -26,21 +26,24 @@ class DownloadChannelHandler(activity: Activity) :
} }
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
if (call.method == "downloadUrl") { when (call.method) {
try { "downloadUrl" -> {
downloadUrl( try {
call.argument("url")!!, downloadUrl(
call.argument("headers"), call.argument("url")!!,
call.argument("mimeType"), call.argument("headers"),
call.argument("filename")!!, call.argument("mimeType"),
call.argument("shouldNotify"), call.argument("filename")!!,
result call.argument("shouldNotify"),
) result
} catch (e: Throwable) { )
result.error("systemException", e.toString(), null) } catch (e: Throwable) {
result.error("systemException", e.toString(), null)
}
}
else -> {
result.notImplemented()
} }
} else {
result.notImplemented()
} }
} }

View file

@ -2,7 +2,7 @@ package com.nkming.nc_photos
interface K { interface K {
companion object { companion object {
const val DOWNLOAD_NOTIFICATION_ID_MIN = 1000; const val DOWNLOAD_NOTIFICATION_ID_MIN = 1000
const val DOWNLOAD_NOTIFICATION_ID_MAX = 2000; const val DOWNLOAD_NOTIFICATION_ID_MAX = 2000
} }
} }