-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
145 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ kotlin.code.style=official | |
|
||
# Publishing | ||
group=co.zsmb | ||
version=1.3.0 | ||
version=2.0.0-alpha02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
requirektx-bundle/src/androidMain/kotlin/co/zsmb/requirektx/BundleArrayList.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@file:Suppress("NOTHING_TO_INLINE") | ||
|
||
package co.zsmb.requirektx | ||
|
||
import androidx.core.bundle.Bundle | ||
import android.os.Parcelable | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.requireParcelableArrayList(key: String): ArrayList<Parcelable> = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.getParcelableArrayListOrNull(key: String): ArrayList<Parcelable>? = getOrNullImpl(key) |
35 changes: 35 additions & 0 deletions
35
requirektx-bundle/src/androidMain/kotlin/co/zsmb/requirektx/BundleArrays.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@file:Suppress("NOTHING_TO_INLINE") | ||
|
||
package co.zsmb.requirektx | ||
|
||
import android.os.Parcelable | ||
import android.util.SparseArray | ||
import androidx.core.bundle.Bundle | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.requireParcelableArray(key: String): Array<Parcelable> = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.getParcelableArrayOrNull(key: String): Array<Parcelable>? = getOrNullImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun <reified T : Parcelable> Bundle.requireSparseParcelableArray(key: String): SparseArray<T> = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun <reified T : Parcelable> Bundle.getSparseParcelableArrayOrNull(key: String): SparseArray<T>? = getOrNullImpl(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
requirektx-bundle/src/commonMain/kotlin/co/zsmb/requirektx/BundleReference.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@file:Suppress("NOTHING_TO_INLINE") | ||
|
||
package co.zsmb.requirektx | ||
|
||
import androidx.core.bundle.Bundle | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.requireString(key: String): String = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.getStringOrNull(key: String): String? = getOrNullImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.requireCharSequence(key: String): CharSequence = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.getCharSequenceOrNull(key: String): CharSequence? = getOrNullImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key. | ||
* | ||
* @throws IllegalArgumentException if the key does not exist. | ||
* @throws IllegalStateException if the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.requireBundle(key: String): Bundle = requireImpl(key) | ||
|
||
/** | ||
* Returns the value associated with the given key, or null if the key doesn't exist, | ||
* or the stored value is of the wrong type. | ||
*/ | ||
public inline fun Bundle.getBundleOrNull(key: String): Bundle? = getOrNullImpl(key) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
android-only=true |
2 changes: 2 additions & 0 deletions
2
requirektx-intent/src/commonMain/kotlin/co/zsmb/requirektx/Dummy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package co.zsmb.requirektx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
android-only=true |
2 changes: 2 additions & 0 deletions
2
requirektx-work/src/commonMain/kotlin/co/zsmb/requirektx/Dummy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package co.zsmb.requirektx | ||
|