Skip to content

Commit b069b92

Browse files
Enable Stetho in example app (#1240)
Remove unused dependency
1 parent 7b1c6ae commit b069b92

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

example/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ dependencies {
2222
/* Used for server calls */
2323
implementation 'com.squareup.okio:okio:2.2.2'
2424
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
25+
implementation 'com.facebook.stetho:stetho:1.5.1'
26+
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
2527

2628
/* Used to make Retrofit easier and GSON & Rx-compatible*/
2729
implementation 'com.google.code.gson:gson:2.8.5'

example/src/main/java/com/stripe/example/ExampleApplication.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.support.multidex.MultiDexApplication;
44

5+
import com.facebook.stetho.Stetho;
56
import com.squareup.leakcanary.LeakCanary;
67

78
public class ExampleApplication extends MultiDexApplication {
@@ -10,6 +11,8 @@ public class ExampleApplication extends MultiDexApplication {
1011
public void onCreate() {
1112
super.onCreate();
1213

14+
Stetho.initializeWithDefaults(this);
15+
1316
if (BuildConfig.DEBUG && LeakCanary.isInAnalyzerProcess(this)) {
1417
// This process is dedicated to LeakCanary for heap analysis.
1518
// You should not init your app in this process.

example/src/main/java/com/stripe/example/module/RetrofitFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.support.annotation.NonNull;
44
import android.support.annotation.Nullable;
55

6+
import com.facebook.stetho.okhttp3.StethoInterceptor;
67
import com.google.gson.Gson;
78
import com.google.gson.GsonBuilder;
89

@@ -31,6 +32,7 @@ public static Retrofit getInstance() {
3132

3233
final OkHttpClient httpClient = new OkHttpClient.Builder()
3334
.addInterceptor(logging)
35+
.addNetworkInterceptor(new StethoInterceptor())
3436
.build();
3537

3638
final Gson gson = new GsonBuilder()

stripe/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ dependencies {
3434
androidTestImplementation 'com.android.support.test:rules:1.0.2'
3535
androidTestImplementation 'androidx.test:runner:1.2.0'
3636
androidTestUtil 'androidx.test:orchestrator:1.2.0'
37-
38-
testAnnotationProcessor 'com.google.auto.service:auto-service:1.0-rc4'
3937
}
4038

4139
android {

0 commit comments

Comments
 (0)