diff --git a/build.gradle b/build.gradle index 32070d7..731c634 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,11 @@ buildscript { - ext.kotlin_version = '1.5.10' repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:4.2.1" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" } } diff --git a/oscexchange/build.gradle b/oscexchange/build.gradle index eeace15..aa8f031 100644 --- a/oscexchange/build.gradle +++ b/oscexchange/build.gradle @@ -1,7 +1,8 @@ plugins { id 'com.android.library' + id 'kotlin-android' + id 'kotlin-parcelize' } -apply plugin: 'kotlin-android' android { compileSdkVersion 30 diff --git a/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCAddress.kt b/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCAddress.kt index 368a7b5..05cefca 100644 --- a/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCAddress.kt +++ b/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCAddress.kt @@ -1,5 +1,7 @@ package ac.at.fhstp.digitech.oscexchange +import android.os.Parcelable +import kotlinx.parcelize.Parcelize import java.util.* import java.util.regex.Pattern @@ -8,7 +10,9 @@ import java.util.regex.Pattern * * @see OSCAddress.tryCreate */ -class OSCAddress private constructor(@PublicApi val value: String?) { +@Parcelize +class OSCAddress private constructor(@PublicApi val value: String?) : + Parcelable { companion object { /** * The pattern used to validate OSCAddresses diff --git a/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCDevicePair.kt b/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCDevicePair.kt index 22f76a8..bf17a00 100644 --- a/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCDevicePair.kt +++ b/oscexchange/src/main/java/ac/at/fhstp/digitech/oscexchange/OSCDevicePair.kt @@ -1,13 +1,16 @@ package ac.at.fhstp.digitech.oscexchange import ac.at.fhstp.digitech.oscexchange.errors.OSCPortOpeningException +import android.os.Parcelable import com.illposed.osc.transport.udp.OSCPortIn import com.illposed.osc.transport.udp.OSCPortOut +import kotlinx.parcelize.Parcelize import java.net.InetSocketAddress /** * Contains information about a pair of devices that communicate over OSC */ +@Parcelize class OSCDevicePair @PublicApi constructor( /** * The address of this device @@ -17,7 +20,7 @@ class OSCDevicePair @PublicApi constructor( * The address of the other device */ @PublicApi val remote: InetSocketAddress -) { +) : Parcelable { fun tryOpenInPort() = try {