Skip to content

Commit

Permalink
Release/1.0.4 (#1)
Browse files Browse the repository at this point in the history
[release] 1.0.4
- version set to 1.0.4
- description added to safeSetAdapter
- proper suppression in viewBinding
- dependencies bump
- release option deleted
- proguard-rules.pro deleted
  • Loading branch information
GrzegorzBobryk authored Oct 2, 2023
1 parent 9c8910c commit 34a9d1c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 53 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ repositories {

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {

android {
namespace 'pl.beavercoding.viewbindingdelegate'
compileSdkVersion Config.compileSdk
compileSdk Config.compileSdk

defaultConfig {
applicationId "pl.beavercoding.viewbindingdelegate"
Expand All @@ -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
Expand Down
16 changes: 5 additions & 11 deletions view-binder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

android {
namespace 'pl.beavercoding.view_binder'
compileSdkVersion Config.compileSdk
compileSdk Config.compileSdk

defaultConfig {
minSdkVersion Config.minSdk
Expand All @@ -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()
}
}

Expand All @@ -48,7 +42,7 @@ afterEvaluate {

groupId = 'com.github.grzegorzbobryk'
artifactId = 'view-binder'
version = '1.0.3'
version = '1.0.4'
}
}
}
Expand Down
21 changes: 0 additions & 21 deletions view-binder/proguard-rules.pro

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun interface ViewBinder<T : ViewBinding> {
/**
* Lazy create new [ViewBinding] associated with the [Fragment][this] via delegate without any reflection.
*/
@Suppress("unused")
@Suppress("UnusedReceiverParameter")
inline fun <reified T : ViewBinding> Fragment.viewBinding(vb: ViewBinder<T>): ReadOnlyProperty<Fragment, T> =
FragmentViewBindingProperty(vb)

Original file line number Diff line number Diff line change
Expand Up @@ -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 <VH : RecyclerView.ViewHolder> RecyclerView.safeSetAdapter(
adapter: RecyclerView.Adapter<VH>
Expand Down

0 comments on commit 34a9d1c

Please sign in to comment.