GeezerVison is showing github.com — refactor: use BaseFragment with LeakCanary RefWatcher · tdao407/Android-RxJava@835e288
File tree
Expand file treeCollapse file tree
Open diff view settings
app/src/main/java/com/morihacky/android/rxjava
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +package com.morihacky.android.rxjava; |
| 2 | + |
| 3 | +import android.support.v4.app.Fragment; |
| 4 | +import com.squareup.leakcanary.RefWatcher; |
| 5 | + |
| 6 | +public class BaseFragment |
| 7 | + extends Fragment { |
| 8 | + |
| 9 | + @Override |
| 10 | + public void onDestroy() { |
| 11 | + super.onDestroy(); |
| 12 | + RefWatcher refWatcher = MyApp.getRefWatcher(); |
| 13 | + refWatcher.watch(this); |
| 14 | + } |
| 15 | +} |
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/BufferDemoFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
34 | 34 | * as demonstrated in the case of {@link com.morihacky.android.rxjava.SubjectDebounceSearchEmitterFragment} |
35 | 35 | */ |
36 | 36 | public class BufferDemoFragment |
37 | | - extends Fragment { |
| 37 | + extends BaseFragment { |
38 | 38 |
|
39 | 39 | @InjectView(R.id.list_threading_log) ListView _logsList; |
40 | 40 | @InjectView(R.id.btn_start_operation) Button _tapBtn; |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/ConcurrencyWithSchedulersDemoFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
28 | 28 | import timber.log.Timber; |
29 | 29 |
|
30 | 30 | public class ConcurrencyWithSchedulersDemoFragment |
31 | | - extends Fragment { |
| 31 | + extends BaseFragment { |
32 | 32 |
|
33 | 33 | @InjectView(R.id.progress_operation_running) ProgressBar _progress; |
34 | 34 | @InjectView(R.id.list_threading_log) ListView _logsList; |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/DemoTimeoutFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
28 | 28 | import timber.log.Timber; |
29 | 29 |
|
30 | 30 | public class DemoTimeoutFragment |
31 | | - extends Fragment { |
| 31 | + extends BaseFragment { |
32 | 32 |
|
33 | 33 | @InjectView(R.id.list_threading_log) ListView _logsList; |
34 | 34 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/DoubleBindingTextViewFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
20 | 20 | import rx.subjects.PublishSubject; |
21 | 21 |
|
22 | 22 | public class DoubleBindingTextViewFragment |
23 | | - extends Fragment { |
| 23 | + extends BaseFragment { |
24 | 24 |
|
25 | 25 | @InjectView(R.id.double_binding_num1) EditText _number1; |
26 | 26 | @InjectView(R.id.double_binding_num2) EditText _number2; |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/FormValidationCombineLatestFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
23 | 23 | import static com.google.common.base.Strings.isNullOrEmpty; |
24 | 24 |
|
25 | 25 | public class FormValidationCombineLatestFragment |
26 | | - extends Fragment { |
| 26 | + extends BaseFragment { |
27 | 27 |
|
28 | 28 | @InjectView(R.id.btn_demo_form_valid) TextView _btnValidIndicator; |
29 | 29 | @InjectView(R.id.demo_combl_email) EditText _email; |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/MainFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
12 | 12 | import com.morihacky.android.rxjava.rxbus.RxBusDemoFragment; |
13 | 13 |
|
14 | 14 | public class MainFragment |
15 | | - extends Fragment { |
| 15 | + extends BaseFragment { |
16 | 16 |
|
17 | 17 | @Override |
18 | 18 | public View onCreateView(LayoutInflater inflater, |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/PollingFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
27 | 27 | import timber.log.Timber; |
28 | 28 |
|
29 | 29 | public class PollingFragment |
30 | | - extends Fragment { |
| 30 | + extends BaseFragment { |
31 | 31 |
|
32 | 32 | public static final int INITIAL_DELAY = 0; |
33 | 33 | public static final int POLLING_INTERVAL = 1000; |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/PseudoCacheConcatFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
30 | 30 | import static java.lang.String.format; |
31 | 31 |
|
32 | 32 | public class PseudoCacheConcatFragment |
33 | | - extends Fragment { |
| 33 | + extends BaseFragment { |
34 | 34 |
|
35 | 35 | @InjectView(R.id.log_list) ListView _resultList; |
36 | 36 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/SubjectDebounceSearchEmitterFragment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
46 | 46 | * incapable of debounce : this is the primary reason, since creating new observable everytime in subscription disregards debounce on subsequent calls |
47 | 47 | */ |
48 | 48 | public class SubjectDebounceSearchEmitterFragment |
49 | | - extends Fragment { |
| 49 | + extends BaseFragment { |
50 | 50 |
|
51 | 51 | @InjectView(R.id.list_threading_log) ListView _logsList; |
52 | 52 |
|
|