From ee4cca98722e709f137154c03c642ba054dc0679 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 26 Sep 2018 14:43:22 +0000 Subject: [PATCH] Hide debug button when not in debug mode --- .idea/misc.xml | 2 +- app/src/main/java/eu/faircode/email/FragmentAbout.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 99202cc2..c0f68edd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -25,7 +25,7 @@ - + diff --git a/app/src/main/java/eu/faircode/email/FragmentAbout.java b/app/src/main/java/eu/faircode/email/FragmentAbout.java index f5ad7f84..bbb560f0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAbout.java +++ b/app/src/main/java/eu/faircode/email/FragmentAbout.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; +import android.preference.PreferenceManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -248,6 +249,10 @@ public class FragmentAbout extends FragmentEx { } }); + boolean debug = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("debug", false); + btnLog.setVisibility(debug ? View.VISIBLE : View.GONE); + btnDebugInfo.setVisibility(debug ? View.VISIBLE : View.GONE); + return view; } }