GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Add LeakCanary to project · ttylinux/Android-RxJava@bb90bb7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app
    • build.gradle
    • src/main
      • AndroidManifest.xml
      • java/com/morihacky/android/rxjava
        • MyApp.java
        • rxbus
          • RxBusDemo_TopFragment.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/build.gradle‎

Copy file name to clipboardExpand all lines: app/build.gradle
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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

1921
android {
@@ -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+
}
Collapse file

‎app/src/main/AndroidManifest.xml‎

Copy file name to clipboardExpand all lines: app/src/main/AndroidManifest.xml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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"
Collapse file

‎app/src/main/java/com/morihacky/android/rxjava/MyApp.java‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}
Collapse file

‎app/src/main/java/com/morihacky/android/rxjava/rxbus/RxBusDemo_TopFragment.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/rxbus/RxBusDemo_TopFragment.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
import android.view.ViewGroup;
99
import butterknife.ButterKnife;
1010
import butterknife.OnClick;
11+
import com.morihacky.android.rxjava.BaseFragment;
1112
import com.morihacky.android.rxjava.MainActivity;
1213
import com.morihacky.android.rxjava.app.R;
1314

1415
public class RxBusDemo_TopFragment
15-
extends Fragment {
16+
extends BaseFragment {
1617

1718
private RxBus _rxBus;
1819

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.