From 65cb3ab696a15c39938bd2a5be7c10ba838fda0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Sun, 18 Sep 2016 16:31:45 +0200 Subject: [PATCH] Added a switch to switch off bug reporting (for dev - too much :)). --- .../pl/tpolgrabia/urbanexplorer/AppConstants.java | 1 + .../java/pl/tpolgrabia/urbanexplorer/AppStage.java | 12 ++++++++++++ .../pl/tpolgrabia/urbanexplorer/MainActivity.java | 9 +++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/pl/tpolgrabia/urbanexplorer/AppStage.java diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppConstants.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppConstants.java index c97aeae..546e1b2 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppConstants.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppConstants.java @@ -6,6 +6,7 @@ package pl.tpolgrabia.urbanexplorer; public class AppConstants { public static final String GOOGLE_API_KEY = "AIzaSyDAnmEK6cgovRrefUuYojL1pxPEbIBLZUw"; public static final long MIN_TIME = 60000; + public static final AppStage RELEASE = AppStage.DEVELOPMENT; public static final float MIN_DISTANCE = 100; public static final float PAMNORAMIO_DEF_RADIUSX = 0.05f; public static final float PAMNORAMIO_DEF_RADIUSY = 0.05f; diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppStage.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppStage.java new file mode 100644 index 0000000..1d995c9 --- /dev/null +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/AppStage.java @@ -0,0 +1,12 @@ +package pl.tpolgrabia.urbanexplorer; + +/** + * Created by tpolgrabia on 18.09.16. + */ +public enum AppStage { + DEVELOPMENT, + ALPHA, + BETA, + RELEASE_CANDIDATE, + FINAL +} diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index bdff32e..818eae4 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -91,7 +91,9 @@ public class MainActivity extends ActionBarActivity { super.onCreate(savedInstanceState); lg.trace("onCreate"); setContentView(R.layout.activity_main); - AQUtility.setDebug(false); + + AQUtility.setDebug(AppConstants.RELEASE != AppStage.FINAL + && AppConstants.RELEASE != AppStage.RELEASE_CANDIDATE); NetUtils.setGlobalProxyAuth(this); @@ -115,7 +117,10 @@ public class MainActivity extends ActionBarActivity { gestureDetector = new GestureDetectorCompat(this, swipeHandler); locationCallback = new StandardLocationListener(); initLocalication(); - Fabric.with(this, new Crashlytics()); + if (AppConstants.RELEASE == AppStage.FINAL + || AppConstants.RELEASE == AppStage.RELEASE_CANDIDATE) { + Fabric.with(this, new Crashlytics()); + } Integer fragId = savedInstanceState != null ? savedInstanceState.getInt(FRAG_ID) : null; lg.trace("Restored orig frag id: {}", fragId);