aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-cordova
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-07-13 01:22:56 +0200
committerRobert Jaros <rjaros@finn.pl>2019-07-13 01:22:56 +0200
commit426da03b5a4e2d715c086e1bfd92b34358ae17ee (patch)
treec842225bf95ee06399cbc9caf546d467f24246cf /kvision-modules/kvision-cordova
parentba5c00b6992d28cfb6afc7fab108c9009f9e1b7c (diff)
downloadkvision-426da03b5a4e2d715c086e1bfd92b34358ae17ee.tar.gz
kvision-426da03b5a4e2d715c086e1bfd92b34358ae17ee.tar.bz2
kvision-426da03b5a4e2d715c086e1bfd92b34358ae17ee.zip
Style fixes. Suppress style warnings.
Diffstat (limited to 'kvision-modules/kvision-cordova')
-rw-r--r--kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Camera.kt2
-rw-r--r--kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/File.kt3
-rw-r--r--kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/InAppBrowser.kt1
-rw-r--r--kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Screen.kt5
-rw-r--r--kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Splashscreen.kt2
5 files changed, 11 insertions, 2 deletions
diff --git a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Camera.kt b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Camera.kt
index 40c731c7..44f51a3f 100644
--- a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Camera.kt
+++ b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Camera.kt
@@ -158,8 +158,10 @@ object Camera {
if (isCameraActive && resumeEvent.pendingResult != null) {
window.localStorage.removeItem(CAMERA_ACTIVE_STORAGE_KEY)
if (resumeEvent.pendingResult.pluginStatus == CAMERA_STATUS_OK) {
+ @Suppress("UnsafeCastFromDynamic")
resultCallback(Result.success(resumeEvent.pendingResult.result))
} else {
+ @Suppress("UnsafeCastFromDynamic")
resultCallback(Result.error(CameraException(resumeEvent.pendingResult.result)))
}
}
diff --git a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/File.kt b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/File.kt
index 6e7ba732..944042fa 100644
--- a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/File.kt
+++ b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/File.kt
@@ -92,6 +92,7 @@ object File {
suspend fun getSystemDirectories(): SystemDirs {
return suspendCoroutine { continuation ->
addDeviceReadyListener {
+ @Suppress("UnsafeCastFromDynamic")
continuation.resume(window.asDynamic().cordova.file)
}
}
@@ -163,7 +164,7 @@ object File {
*/
@Suppress("UnsafeCastFromDynamic")
suspend fun requestFileSystem(
- fileSystemType: File.FileSystemType,
+ fileSystemType: FileSystemType,
size: Long = 0
): Result<FileSystem, FileException> {
return suspendCoroutine { continuation ->
diff --git a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/InAppBrowser.kt b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/InAppBrowser.kt
index c0c8f0b4..5ca8cf6f 100644
--- a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/InAppBrowser.kt
+++ b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/InAppBrowser.kt
@@ -66,6 +66,7 @@ object InAppBrowser {
return suspendCoroutine { continuation ->
addDeviceReadyListener {
val ref = window.asDynamic().cordova.InAppBrowser.open(url, target, options)
+ @Suppress("UnsafeCastFromDynamic")
continuation.resume(ref)
}
}
diff --git a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Screen.kt b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Screen.kt
index 6765b44e..a33b2453 100644
--- a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Screen.kt
+++ b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Screen.kt
@@ -62,7 +62,10 @@ object Screen {
*/
fun getOrientation(): Orientation {
val type = window.screen.asDynamic().orientation.type
- return Orientation.values().find { it.type == type } ?: Screen.Orientation.ANY
+ return Orientation.values().find {
+ @Suppress("UnsafeCastFromDynamic")
+ it.type == type
+ } ?: Screen.Orientation.ANY
}
/**
diff --git a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Splashscreen.kt b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Splashscreen.kt
index 03157534..c300c194 100644
--- a/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Splashscreen.kt
+++ b/kvision-modules/kvision-cordova/src/main/kotlin/pl/treksoft/kvision/cordova/Splashscreen.kt
@@ -34,6 +34,7 @@ object Splashscreen {
*/
fun show() {
addDeviceReadyListener {
+ @Suppress("UnsafeCastFromDynamic")
window.navigator.asDynamic().splashscreen.show()
}
}
@@ -43,6 +44,7 @@ object Splashscreen {
*/
fun hide() {
addDeviceReadyListener {
+ @Suppress("UnsafeCastFromDynamic")
window.navigator.asDynamic().splashscreen.hide()
}
}