adding LeakCanary and BaseSplashActivity

This commit is contained in:
tibbi 2017-11-30 00:07:30 +01:00
parent 1a752eb757
commit b6b8e71ec4
3 changed files with 23 additions and 5 deletions

View file

@ -20,10 +20,14 @@ android {
}
buildTypes {
debug {
buildConfigField "boolean", "USE_LEAK_CANARY", "true"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField "boolean", "USE_LEAK_CANARY", "false"
}
}
@ -37,10 +41,17 @@ android {
}
}
ext {
leakCanaryVersion = '1.5.4'
}
dependencies {
implementation 'com.simplemobiletools:commons:3.0.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
}
Properties props = new Properties()

View file

@ -2,10 +2,19 @@ package com.simplemobiletools.musicplayer
import android.app.Application
import com.facebook.stetho.Stetho
import com.simplemobiletools.musicplayer.BuildConfig.USE_LEAK_CANARY
import com.squareup.leakcanary.LeakCanary
class App : Application() {
override fun onCreate() {
super.onCreate()
if (USE_LEAK_CANARY) {
if (LeakCanary.isInAnalyzerProcess(this)) {
return
}
LeakCanary.install(this)
}
Stetho.initializeWithDefaults(this)
}
}

View file

@ -1,12 +1,10 @@
package com.simplemobiletools.musicplayer.activities
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.simplemobiletools.commons.activities.BaseSplashActivity
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
class SplashActivity : BaseSplashActivity() {
override fun initActivity() {
startActivity(Intent(this, MainActivity::class.java))
finish()
}