Skip to content

Commit

Permalink
Added leakcanary to mail sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sockeqwe committed Aug 31, 2015
1 parent 947629e commit eac7aa8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sample-mail/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ dependencies {
compile 'com.hannesdorfmann.parcelableplease:annotation:' + rootProject.ext.parcelablepleaseVersion
apt 'com.hannesdorfmann.parcelableplease:processor:' + rootProject.ext.parcelablepleaseVersion

compile 'com.jakewharton:butterknife:'+rootProject.ext.butterknifeVersion
compile 'com.jakewharton:butterknife:' + rootProject.ext.butterknifeVersion

compile 'frankiesardo:icepick:'+rootProject.ext.icepickVersion
compile 'frankiesardo:icepick:' + rootProject.ext.icepickVersion
apt 'frankiesardo:icepick-processor:' + rootProject.ext.icepickVersion
compile 'com.hannesdorfmann.fragmentargs:annotation:' + rootProject.ext.fragmentargsVersion
apt 'com.hannesdorfmann.fragmentargs:processor:' + rootProject.ext.fragmentargsVersion
Expand All @@ -70,6 +70,9 @@ dependencies {
compile 'javax.annotation:javax.annotation-api:1.2'


compile 'com.squareup.leakcanary:leakcanary-android:' + rootProject.ext.leakcanaryVersion


testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:' + rootProject.ext.robolectricVersion
provided 'com.google.code.findbugs:annotations:3.0.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
package com.hannesdorfmann.mosby.sample.mail;

import android.app.Application;
import android.content.Context;
import com.hannesdorfmann.mosby.sample.mail.dagger.DaggerMailAppComponent;
import com.hannesdorfmann.mosby.sample.mail.dagger.MailAppComponent;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

/**
* @author Hannes Dorfmann
*/
public class MailApplication extends Application {

private RefWatcher refWatcher;

private static MailAppComponent mailComponent;

@Override public void onCreate() {
super.onCreate();
mailComponent = DaggerMailAppComponent.create();
refWatcher = LeakCanary.install(this);
}

public static RefWatcher getRefWatcher(Context context) {
MailApplication application = (MailApplication) context.getApplicationContext();
return application.refWatcher;
}

public static MailAppComponent getMailComponents() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
protected void injectDependencies() {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
ButterKnife.unbind(this);
}


/**
* Inject the dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
ButterKnife.unbind(this);
}


/**
* Inject the dependencies
*/
Expand Down

0 comments on commit eac7aa8

Please sign in to comment.