Replace Stetho with Flipper

pull/820/head
Alex Baker 5 years ago
parent 787060c35b
commit 4997ec3f0e

@ -119,7 +119,6 @@ configurations {
final DAGGER_VERSION = '2.22.1'
final BUTTERKNIFE_VERSION = '10.1.0'
final STETHO_VERSION = '1.5.1'
final WORK_VERSION = '2.0.1'
final LEAKCANARY_VERSION = '1.6.3'
final ROOM_VERSION = '2.1.0-beta01'
@ -141,10 +140,9 @@ dependencies {
annotationProcessor "com.jakewharton:butterknife-compiler:${BUTTERKNIFE_VERSION}"
implementation "com.jakewharton:butterknife:${BUTTERKNIFE_VERSION}"
debugImplementation("com.facebook.stetho:stetho:${STETHO_VERSION}") {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
debugImplementation "com.facebook.stetho:stetho-timber:${STETHO_VERSION}@aar"
debugImplementation 'com.facebook.flipper:flipper:0.21.0'
debugImplementation 'com.facebook.soloader:soloader:0.6.0'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${LEAKCANARY_VERSION}"
debugImplementation "com.squareup.leakcanary:leakcanary-support-fragment:${LEAKCANARY_VERSION}"

@ -3,8 +3,14 @@ package org.tasks;
import android.app.Application;
import android.content.Context;
import android.os.StrictMode;
import com.facebook.stetho.Stetho;
import com.facebook.stetho.timber.StethoTree;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.soloader.SoLoader;
import com.squareup.leakcanary.LeakCanary;
import javax.inject.Inject;
import org.tasks.injection.ForApplication;
@ -24,9 +30,13 @@ public class BuildSetup {
public boolean setup() {
Timber.plant(new Timber.DebugTree());
if (preferences.getBoolean(R.string.p_stetho, false)) {
Timber.plant(new StethoTree());
Stetho.initializeWithDefaults(context);
if (preferences.getBoolean(R.string.p_flipper, false) && FlipperUtils.shouldEnableFlipper(context)) {
SoLoader.init(context, false);
FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.start();
}
Application application = (Application) context.getApplicationContext();
if (LeakCanary.isInAnalyzerProcess(context)) {

@ -17,7 +17,7 @@ public class DebugPreferences extends InjectingPreferenceActivity {
for (int pref :
asList(
R.string.p_stetho,
R.string.p_flipper,
R.string.p_leak_canary,
R.string.p_strict_mode_vm,
R.string.p_strict_mode_thread)) {

@ -6,8 +6,8 @@
android:title="@string/debug_leak_canary" />
<CheckBoxPreference
android:key="@string/p_stetho"
android:title="@string/debug_stetho" />
android:key="@string/p_flipper"
android:title="@string/debug_flipper" />
<CheckBoxPreference
android:key="@string/p_strict_mode_thread"

@ -282,7 +282,7 @@
<string name="debug_strict_mode_thread">Strict mode - Thread</string>
<string name="debug_strict_mode_vm">Strict mode - VM</string>
<string name="debug_leak_canary">LeakCanary</string>
<string name="debug_stetho">Stetho</string>
<string name="debug_flipper">Flipper</string>
<string name="debug_pro">Unlock pro</string>
<string name="debug_buy">Buy</string>
<string name="debug">Debug</string>
@ -293,7 +293,7 @@
<string name="p_strict_mode_vm">strict_mode_vm</string>
<string name="p_strict_mode_thread">strict_mode_thread</string>
<string name="p_leak_canary">leak_canary</string>
<string name="p_stetho">p_stetho</string>
<string name="p_flipper">p_flipper</string>
<string name="p_debug_pro">debug_pro</string>
<string name="warned_play_services">warned_play_services</string>
<string name="p_background_sync_unmetered_only">background_sync_unmetered_only</string>

Loading…
Cancel
Save