Add debug toggle for Stetho

pull/795/head
Alex Baker 5 years ago
parent 268a774b0a
commit 2ea8e368dc

@ -24,8 +24,10 @@ public class BuildSetup {
public boolean setup() { public boolean setup() {
Timber.plant(new Timber.DebugTree()); Timber.plant(new Timber.DebugTree());
Timber.plant(new StethoTree()); if (preferences.getBoolean(R.string.p_stetho, false)) {
Stetho.initializeWithDefaults(context); Timber.plant(new StethoTree());
Stetho.initializeWithDefaults(context);
}
Application application = (Application) context.getApplicationContext(); Application application = (Application) context.getApplicationContext();
if (LeakCanary.isInAnalyzerProcess(context)) { if (LeakCanary.isInAnalyzerProcess(context)) {
return false; return false;

@ -5,6 +5,10 @@
android:key="@string/p_leak_canary" android:key="@string/p_leak_canary"
android:title="@string/debug_leak_canary" /> android:title="@string/debug_leak_canary" />
<CheckBoxPreference
android:key="@string/p_stetho"
android:title="@string/debug_stetho" />
<CheckBoxPreference <CheckBoxPreference
android:key="@string/p_strict_mode_thread" android:key="@string/p_strict_mode_thread"
android:title="@string/debug_strict_mode_thread"/> android:title="@string/debug_strict_mode_thread"/>

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

Loading…
Cancel
Save