Skip to content

Commit

Permalink
Update libs
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim.zhemerenko committed Jan 30, 2024
1 parent 9fe09b9 commit 047465d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.ionic.plugin.android.core.utils

import android.os.Bundle

fun Bundle.optStringSafely(key: String): String? {
if (!containsKey(key)) return null
return getString(key)
}

fun Bundle.getStringSafely(key: String): String {
return optStringSafely(key) ?: throw IllegalArgumentException("String with '$key' not found in the bundle")
}

fun Bundle.optIntSafely(key: String): Int? {
if (!containsKey(key)) return null
return getInt(key)
}

fun Bundle.getIntSafely(key: String): Int {
return optIntSafely(key) ?: throw IllegalArgumentException("Int with '$key' not found in the bundle")
}

fun Bundle.optBooleanSafely(key: String): Boolean? {
if (!containsKey(key)) return null
return getBoolean(key)
}

fun Bundle.getBooleanSafely(key: String): Boolean {
return optBooleanSafely(key) ?: throw IllegalArgumentException("Boolean with '$key' not found in the bundle")
}
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
classpath(kotlin("gradle-plugin", version = kotlinVersion))
classpath(kotlin("serialization", version = kotlinVersion))

classpath("com.android.tools.build:gradle:7.2.2")
classpath("com.android.tools.build:gradle:7.4.2")
}
}

Expand All @@ -21,9 +21,9 @@ allprojects {

extra.apply {
set("kotlinxCoroutinesCoreVersion", "1.7.3")
set("kotlinxSerializationJsonVersion", "1.6.1")
set("kotlinxAtomicfuVersion", "0.23.1")
set("kotlinxSerializationJsonVersion", "1.6.2")
set("kotlinxAtomicfuVersion", "0.23.2")
set("androidxAppcompatVersion", "1.6.1")
set("mavenGroup", "com.github.SpryRocks.ionic-plugin-core")
set("mavenVersion", "0.1.13-alpha.0")
set("mavenVersion", "0.1.14-alpha.3")
}

0 comments on commit 047465d

Please sign in to comment.