diff --git a/README.md b/README.md index e795708..4cd4d64 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ and the dependency itself ```gradle dependencies { - implementation 'com.github.GrzegorzBobryk:ViewBindingDelegate:1.0.3' + implementation 'com.github.GrzegorzBobryk:ViewBindingDelegate:1.0.4' } ``` @@ -48,7 +48,7 @@ class ExampleFragment : Fragment(R.layout.fragment_example) { } ``` -You can also use `safeSetAdapter` to automatically clean adapter reference from fragment +You can also use `safeSetAdapter` to automatically clean adapter reference from fragment. Do **not** call it from pagers. ```kotlin class ExampleFragment1 : Fragment(R.layout.fragment_example) { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2f4ede9..aae13ee 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,6 +10,6 @@ repositories { tasks.withType { kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } } diff --git a/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Config.kt b/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Config.kt index ec955d0..54a5e19 100644 --- a/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Config.kt +++ b/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Config.kt @@ -3,8 +3,8 @@ package pl.beavercoding.viewbindingdelegate.buildsrc object Config { - const val compileSdk = 33 + const val compileSdk = 34 const val minSdk = 21 - const val targetSdk = 33 + const val targetSdk = 34 const val testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Libs.kt b/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Libs.kt index 956df4f..ef193ed 100644 --- a/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Libs.kt +++ b/buildSrc/src/main/java/pl/beavercoding/viewbindingdelegate/buildsrc/Libs.kt @@ -3,20 +3,20 @@ package pl.beavercoding.viewbindingdelegate.buildsrc object Libs { - private const val androidGradlePluginVersion = "7.4.1" + private const val androidGradlePluginVersion = "8.1.2" const val androidGradlePlugin = "com.android.tools.build:gradle:$androidGradlePluginVersion" const val junit = "junit:junit:4.13.2" object Androidx { - const val core = "androidx.core:core-ktx:1.9.0" - const val appcompat = "androidx.appcompat:appcompat:1.6.0" + const val core = "androidx.core:core-ktx:1.12.0" + const val appcompat = "androidx.appcompat:appcompat:1.6.1" const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4" const val viewBinding = "androidx.databinding:viewbinding:$androidGradlePluginVersion" - const val recyclerView = "androidx.recyclerview:recyclerview:1.2.1" + const val recyclerView = "androidx.recyclerview:recyclerview:1.3.1" object Navigation { - private const val version = "2.5.3" + private const val version = "2.7.3" const val safeArgsPlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:$version" const val fragment = "androidx.navigation:navigation-fragment-ktx:$version" @@ -30,18 +30,18 @@ object Libs { } object Google { - const val material = "com.google.android.material:material:1.8.0" + const val material = "com.google.android.material:material:1.9.0" } object Kotlin { - private const val version = "1.8.0" + private const val version = "1.9.10" const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:$version" const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version" } object CanaryLeak { - private const val version = "2.10" + private const val version = "2.12" const val android = "com.squareup.leakcanary:leakcanary-android:$version" const val androidTests = "com.squareup.leakcanary:leakcanary-android-instrumentation:$version" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3a8e8df..2ec7d68 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Feb 06 14:36:24 CET 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/sample/build.gradle b/sample/build.gradle index ba344db..2b6e838 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -10,7 +10,7 @@ plugins { android { namespace 'pl.beavercoding.viewbindingdelegate' - compileSdkVersion Config.compileSdk + compileSdk Config.compileSdk defaultConfig { applicationId "pl.beavercoding.viewbindingdelegate" @@ -24,16 +24,17 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } buildFeatures { viewBinding true diff --git a/view-binder/build.gradle b/view-binder/build.gradle index 3f12445..d03eef5 100644 --- a/view-binder/build.gradle +++ b/view-binder/build.gradle @@ -9,7 +9,7 @@ plugins { android { namespace 'pl.beavercoding.view_binder' - compileSdkVersion Config.compileSdk + compileSdk Config.compileSdk defaultConfig { minSdkVersion Config.minSdk @@ -19,18 +19,12 @@ android { consumerProguardFiles "consumer-rules.pro" } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } } @@ -48,7 +42,7 @@ afterEvaluate { groupId = 'com.github.grzegorzbobryk' artifactId = 'view-binder' - version = '1.0.3' + version = '1.0.4' } } } diff --git a/view-binder/proguard-rules.pro b/view-binder/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/view-binder/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/view-binder/src/main/java/pl/beavercoding/view_binder/fragmentViewBindingProperty.kt b/view-binder/src/main/java/pl/beavercoding/view_binder/fragmentViewBindingProperty.kt index b5285e5..cb6ed3a 100644 --- a/view-binder/src/main/java/pl/beavercoding/view_binder/fragmentViewBindingProperty.kt +++ b/view-binder/src/main/java/pl/beavercoding/view_binder/fragmentViewBindingProperty.kt @@ -53,7 +53,7 @@ fun interface ViewBinder { /** * Lazy create new [ViewBinding] associated with the [Fragment][this] via delegate without any reflection. */ -@Suppress("unused") +@Suppress("UnusedReceiverParameter") inline fun Fragment.viewBinding(vb: ViewBinder): ReadOnlyProperty = FragmentViewBindingProperty(vb) diff --git a/view-binder/src/main/java/pl/beavercoding/view_binder/recyclerExtensions.kt b/view-binder/src/main/java/pl/beavercoding/view_binder/recyclerExtensions.kt index 1284369..f65a484 100644 --- a/view-binder/src/main/java/pl/beavercoding/view_binder/recyclerExtensions.kt +++ b/view-binder/src/main/java/pl/beavercoding/view_binder/recyclerExtensions.kt @@ -4,7 +4,7 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView /** - * Safe setting new [RecyclerView.Adapter] that is leak resistant + * Safe setting new [RecyclerView.Adapter] that is leak resistant. Do NOT call it from pagers. */ fun RecyclerView.safeSetAdapter( adapter: RecyclerView.Adapter