diff --git a/Sample/app/build.gradle b/Sample/app/build.gradle index 64a5dcf..9e0cf05 100644 --- a/Sample/app/build.gradle +++ b/Sample/app/build.gradle @@ -5,12 +5,12 @@ plugins { android { namespace "com.veepee.sample" - + compileSdk 34 defaultConfig { applicationId "com.veepee.sample" minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 + versionCode 1 versionName "1.0" diff --git a/Sample/build.gradle b/Sample/build.gradle index 4cdc04b..3d90fce 100644 --- a/Sample/build.gradle +++ b/Sample/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.8.20" + ext.kotlin_version = "1.9.10" repositories { google() mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:8.0.1" + classpath "com.android.tools.build:gradle:8.1.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/Sample/feature_a/build.gradle b/Sample/feature_a/build.gradle index 71c167d..123a8ce 100644 --- a/Sample/feature_a/build.gradle +++ b/Sample/feature_a/build.gradle @@ -5,10 +5,10 @@ plugins { android { namespace "com.veepee.feature.a" + compileSdk 34 defaultConfig { minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -32,7 +32,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion '1.4.6' + kotlinCompilerExtensionVersion '1.5.3' } } diff --git a/Sample/feature_b/build.gradle b/Sample/feature_b/build.gradle index fc20fa8..8063a49 100644 --- a/Sample/feature_b/build.gradle +++ b/Sample/feature_b/build.gradle @@ -5,11 +5,10 @@ plugins { android { namespace "com.veepee.feature.b" - + compileSdk 34 defaultConfig { minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -33,7 +32,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion '1.4.6' + kotlinCompilerExtensionVersion '1.5.3' } } diff --git a/Sample/gradle/wrapper/gradle-wrapper.properties b/Sample/gradle/wrapper/gradle-wrapper.properties index 37aef8d..744c64d 100644 --- a/Sample/gradle/wrapper/gradle-wrapper.properties +++ b/Sample/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/Sample/login/build.gradle b/Sample/login/build.gradle index eda3697..9fd3f01 100644 --- a/Sample/login/build.gradle +++ b/Sample/login/build.gradle @@ -6,11 +6,10 @@ plugins { android { namespace "com.veepee.feature.login" - + compileSdk 34 defaultConfig { minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" diff --git a/Sample/routes/build.gradle b/Sample/routes/build.gradle index b86e9b1..1d80fd0 100644 --- a/Sample/routes/build.gradle +++ b/Sample/routes/build.gradle @@ -6,11 +6,10 @@ plugins { android { namespace "com.veepee.routes" - + compileSdk 34 defaultConfig { minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -38,5 +37,5 @@ dependencies { implementation libs.androidx.appcompat implementation libs.material - api 'com.veepee.vpcore.link-router:link-router:0.3.0' + api 'com.veepee.vpcore.link-router:link-router:0.5.2' } diff --git a/build.gradle b/build.gradle index 4cdc04b..3d90fce 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.8.20" + ext.kotlin_version = "1.9.10" repositories { google() mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:8.0.1" + classpath "com.android.tools.build:gradle:8.1.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/changelog/next/CORE_FCAN-2021_update-link-router-libraries.md b/changelog/next/CORE_FCAN-2021_update-link-router-libraries.md new file mode 100644 index 0000000..2270fac --- /dev/null +++ b/changelog/next/CORE_FCAN-2021_update-link-router-libraries.md @@ -0,0 +1,6 @@ +--- +title: update libraries +url: https://jira.vptech.eu/browse/FCAN-2021 +author: Julio Cesar Bueno Cotta +--- +Closes FCAN-2021 diff --git a/library/build.gradle b/library/build.gradle index 0ac3347..5188df9 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,10 +7,10 @@ plugins { android { namespace = "com.veepee.vpcore.link.route" + compileSdk 34 defaultConfig { minSdkVersion 21 targetSdkVersion 33 - compileSdk 33 aarMetadata { minCompileSdk = 21 } @@ -37,7 +37,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion '1.4.6' + kotlinCompilerExtensionVersion '1.5.3' } testOptions { diff --git a/library/src/main/java/com/veepee/vpcore/route/BundleExtensions.kt b/library/src/main/java/com/veepee/vpcore/route/BundleExtensions.kt index f3592e2..fb0978e 100644 --- a/library/src/main/java/com/veepee/vpcore/route/BundleExtensions.kt +++ b/library/src/main/java/com/veepee/vpcore/route/BundleExtensions.kt @@ -18,41 +18,44 @@ package com.veepee.vpcore.route import android.app.Activity import android.content.Intent import android.os.Bundle +import androidx.core.content.IntentCompat +import androidx.core.os.BundleCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.lifecycle.LifecycleOwner import com.veepee.vpcore.route.link.Parameter import com.veepee.vpcore.route.link.ParcelableParameter -internal val LINK_PARAMETER = "${Parameter::class.java.name}.LINK_PARAMETER" -internal val LINK_PARAMETER_REQUEST_KEY = "${LINK_PARAMETER}_REQUEST_KEY" +val LINK_PARAMETER = "${Parameter::class.java.name}.LINK_PARAMETER" +val LINK_PARAMETER_REQUEST_KEY = "${LINK_PARAMETER}_REQUEST_KEY" -fun Activity.requireLinkParameter(): T { +inline fun Activity.requireLinkParameter(): T { return intent.requireLinkParameter() } -fun Intent.requireLinkParameter(): T { +inline fun Intent.requireLinkParameter(): T { return getLinkParameter()!! } -fun Intent.getLinkParameter(): T? { - return getParcelableExtra(LINK_PARAMETER) +inline fun Intent.getLinkParameter(): T? { + return IntentCompat.getParcelableExtra(this, LINK_PARAMETER, T::class.java) } -fun Bundle.requireLinkParameter(): T { +inline fun Bundle.requireLinkParameter(): T { return getLinkParameter()!! } -fun Bundle.getLinkParameter(): T? { - return getParcelable(LINK_PARAMETER) +inline fun Bundle.getLinkParameter(): T? { + return BundleCompat.getParcelable(this, LINK_PARAMETER, T::class.java) } -fun Fragment.requireLinkParameter(): T { +inline fun Fragment.requireLinkParameter(): T { return getLinkParameter()!! } -fun Fragment.getLinkParameter(): T? { - return arguments?.getParcelable(LINK_PARAMETER) +inline fun Fragment.getLinkParameter(): T? { + val args = arguments ?: return null + return BundleCompat.getParcelable(args, LINK_PARAMETER, T::class.java) } fun FragmentManager.setLinkParameterResult( @@ -62,10 +65,10 @@ fun FragmentManager.setLinkParameterResult( setFragmentResult(requestKey, parameter.asBundle()) } -fun FragmentManager.setLinkParameterResultListener( +inline fun FragmentManager.setLinkParameterResultListener( requestKey: String = LINK_PARAMETER_REQUEST_KEY, lifecycleOwner: LifecycleOwner, - listener: (T) -> Unit + crossinline listener: (T) -> Unit ) { setFragmentResultListener( requestKey, diff --git a/library/src/main/java/com/veepee/vpcore/route/link/compose/NoComposableNameMapperException.kt b/library/src/main/java/com/veepee/vpcore/route/link/compose/NoComposableNameMapperException.kt index 0999232..c275bd3 100644 --- a/library/src/main/java/com/veepee/vpcore/route/link/compose/NoComposableNameMapperException.kt +++ b/library/src/main/java/com/veepee/vpcore/route/link/compose/NoComposableNameMapperException.kt @@ -15,5 +15,5 @@ */ package com.veepee.vpcore.route.link.compose -internal class NoComposableNameMapperException(composableLink: ComposableLink) : +internal class NoComposableNameMapperException(composableLink: ComposableLink) : IllegalArgumentException("$composableLink has no registered ComposableNameMapper registered for it.") diff --git a/library/src/main/java/com/veepee/vpcore/route/link/compose/chain/ComposableLinkInterceptor.kt b/library/src/main/java/com/veepee/vpcore/route/link/compose/chain/ComposableLinkInterceptor.kt index 0035cd1..a816a66 100644 --- a/library/src/main/java/com/veepee/vpcore/route/link/compose/chain/ComposableLinkInterceptor.kt +++ b/library/src/main/java/com/veepee/vpcore/route/link/compose/chain/ComposableLinkInterceptor.kt @@ -22,4 +22,4 @@ import com.veepee.vpcore.route.link.compose.ComposableNameMapper import com.veepee.vpcore.route.link.interceptor.LinkInterceptor interface ComposableLinkInterceptor : - LinkInterceptor, ComposableLink> + LinkInterceptor, ComposableLink> diff --git a/library/src/main/java/com/veepee/vpcore/route/link/fragment/FragmentLinkRouter.kt b/library/src/main/java/com/veepee/vpcore/route/link/fragment/FragmentLinkRouter.kt index 24a3b9b..2764fa7 100644 --- a/library/src/main/java/com/veepee/vpcore/route/link/fragment/FragmentLinkRouter.kt +++ b/library/src/main/java/com/veepee/vpcore/route/link/fragment/FragmentLinkRouter.kt @@ -89,7 +89,7 @@ internal class FragmentLinkRouterImpl( if (newFragmentLink != fragmentLink) { return fragmentFor(newFragmentLink) } - val fragment = mapper.map(fragmentLink).newInstance() + val fragment = mapper.map(fragmentLink).getDeclaredConstructor().newInstance() return fragment.apply { arguments = Bundle().setLinkParameter(fragmentLink.parameter) } diff --git a/settings.gradle b/settings.gradle index 7849d1d..11d3006 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,10 +5,10 @@ include ':library' dependencyResolutionManagement { versionCatalogs { libs { - def kotlinVersion = version('koltin', "1.8.20") + def kotlinVersion = version('koltin', "1.9.10") library('lang.kotlin', 'org.jetbrains.kotlin', 'kotlin-stdlib').versionRef(kotlinVersion) - library('androidx.core', 'androidx.core', 'core').versionRef(version('core', '1.10.0')) - library('androidx.fragment', 'androidx.fragment', 'fragment').versionRef(version('fragment', '1.5.7')) + library('androidx.core', 'androidx.core', 'core').versionRef(version('core', '1.12.0')) + library('androidx.fragment', 'androidx.fragment', 'fragment').versionRef(version('fragment', '1.6.1')) library('material.components', 'com.google.android.material', 'material').versionRef(version('material', '1.8.0')) library('test.junit', 'junit', 'junit').versionRef(version('junit', '4.13.1')) library('test.androidx.test.core', 'androidx.test', 'core-ktx').versionRef(version('core-test', '1.5.0')) @@ -16,7 +16,7 @@ dependencyResolutionManagement { library('test.mockito.inline', 'org.mockito', 'mockito-inline').versionRef(version('mockito-inline', '3.11.2')) library('test.mockito.kotlin', 'org.mockito.kotlin', 'mockito-kotlin').versionRef(version('mockito-kotlin', '3.2.0')) - def composeVersion = version('compose', '1.4.2') + def composeVersion = version('compose', '1.5.3') library('androidx.compose.foundation', 'androidx.compose.foundation', 'foundation').versionRef(composeVersion) library('androidx.compose.ui.test', 'androidx.compose.ui', 'ui-test-junit4').versionRef(composeVersion) library('androidx.compose.ui.test.manifest', 'androidx.compose.ui', 'ui-test-manifest').versionRef(composeVersion)