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,7 +26,8 @@ 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) {
"downloadUrl" -> {
try { try {
downloadUrl( downloadUrl(
call.argument("url")!!, call.argument("url")!!,
@ -39,10 +40,12 @@ class DownloadChannelHandler(activity: Activity) :
} catch (e: Throwable) { } catch (e: Throwable) {
result.error("systemException", e.toString(), null) result.error("systemException", e.toString(), null)
} }
} else { }
else -> {
result.notImplemented() result.notImplemented()
} }
} }
}
private fun downloadUrl( private fun downloadUrl(
url: String, url: String,

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
} }
} }