File tree Expand file tree Collapse file tree 4 files changed +36
-7
lines changed
java/com/morihacky/android/rxjava Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ dependencies {
1414 compile ' com.squareup.okhttp:okhttp:2.0.0'
1515 compile ' com.squareup.okhttp:okhttp-urlconnection:2.0.0'
1616
17+ debugCompile ' com.squareup.leakcanary:leakcanary-android:1.3'
18+ releaseCompile ' com.squareup.leakcanary:leakcanary-android-no-op:1.3'
1719}
1820
1921android {
@@ -33,8 +35,4 @@ android {
3335 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
3436 }
3537 }
36- }
37-
38- dependencies {
39- compile fileTree(dir : ' libs' , include : [' *.jar' ])
40- }
38+ }
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3- package =" com.morihacky.android.rxjava.app " >
3+ package =" com.morihacky.android.rxjava" >
44
55 <application
6+ android : name =" .MyApp"
67 android : allowBackup =" true"
78 android : icon =" @drawable/ic_launcher"
89 android : label =" @string/app_name"
Original file line number Diff line number Diff line change 1+ package com .morihacky .android .rxjava ;
2+
3+ import android .app .Application ;
4+ import com .squareup .leakcanary .LeakCanary ;
5+ import com .squareup .leakcanary .RefWatcher ;
6+ import timber .log .Timber ;
7+
8+ public class MyApp
9+ extends Application {
10+
11+ private static MyApp _instance ;
12+ private RefWatcher _refWatcher ;
13+
14+ public static MyApp get () {
15+ return _instance ;
16+ }
17+
18+ public static RefWatcher getRefWatcher () {
19+ return MyApp .get ()._refWatcher ;
20+ }
21+
22+ @ Override
23+ public void onCreate () {
24+ super .onCreate ();
25+
26+ _instance = (MyApp ) getApplicationContext ();
27+ _refWatcher = LeakCanary .install (this );
28+ }
29+ }
Original file line number Diff line number Diff line change 88import android .view .ViewGroup ;
99import butterknife .ButterKnife ;
1010import butterknife .OnClick ;
11+ import com .morihacky .android .rxjava .BaseFragment ;
1112import com .morihacky .android .rxjava .MainActivity ;
1213import com .morihacky .android .rxjava .app .R ;
1314
1415public class RxBusDemo_TopFragment
15- extends Fragment {
16+ extends BaseFragment {
1617
1718 private RxBus _rxBus ;
1819
You can’t perform that action at this time.
0 commit comments