Skip to content

Commit 2de80f2

Browse files
committed
Update LeakCanary.
1 parent 60fb601 commit 2de80f2

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

app/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,5 @@ dependencies {
7171
androidTestImplementation(TestLibraries.espressoIntents)
7272

7373
// Development dependencies
74-
//TODO: When upgrading Leak Canary to 2.x, these Noop are no longer necessary.
7574
debugImplementation(DevLibraries.leakCanary)
76-
releaseImplementation(DevLibraries.leakCanaryNoop)
77-
testImplementation(DevLibraries.leakCanaryNoop)
7875
}

app/src/main/kotlin/com/fernandocejas/sample/AndroidApplication.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import android.app.Application
1919
import com.fernandocejas.sample.core.di.ApplicationComponent
2020
import com.fernandocejas.sample.core.di.ApplicationModule
2121
import com.fernandocejas.sample.core.di.DaggerApplicationComponent
22-
import com.squareup.leakcanary.LeakCanary
2322

2423
class AndroidApplication : Application() {
2524

@@ -33,12 +32,7 @@ class AndroidApplication : Application() {
3332
override fun onCreate() {
3433
super.onCreate()
3534
this.injectMembers()
36-
this.initializeLeakDetection()
3735
}
3836

3937
private fun injectMembers() = appComponent.inject(this)
40-
41-
private fun initializeLeakDetection() {
42-
if (BuildConfig.DEBUG) LeakCanary.install(this)
43-
}
4438
}

app/src/main/kotlin/com/fernandocejas/sample/core/extension/View.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fun ViewGroup.inflate(@LayoutRes layoutRes: Int): View =
4343
LayoutInflater.from(context).inflate(layoutRes, this, false)
4444

4545
fun ImageView.loadFromUrl(url: String) =
46-
Glide.with(this.context.applicationContext)
47-
.load(url)
48-
.transition(DrawableTransitionOptions.withCrossFade())
49-
.into(this)!!
46+
Glide.with(this.context.applicationContext)
47+
.load(url)
48+
.transition(DrawableTransitionOptions.withCrossFade())
49+
.into(this)
5050

5151
fun ImageView.loadUrlAndPostponeEnterTransition(url: String, activity: FragmentActivity) {
5252
val target: Target<Drawable> = ImageViewBaseTarget(this, activity)

buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ object TestLibraries {
9595

9696
object DevLibraries {
9797
private object Versions {
98-
const val leakCanary = "1.5"
98+
const val leakCanary = "2.5"
9999
}
100100

101101
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
102-
const val leakCanaryNoop = "com.squareup.leakcanary:leakcanary-android-no-op:${Versions.leakCanary}"
103102
}
104103

105104
object ScriptPlugins {

0 commit comments

Comments
 (0)