Browse Source

Retrieve BuildConfig.DEBUG from Application

Accessing this value directly can lead to bugs as users might return a different
value from isDebug function which they override in MainApplication.
Guy Carmeli 5 years ago
parent
commit
b422dd0761

+ 1
- 3
lib/android/app/src/main/java/com/reactnativenavigation/utils/ImageLoader.java View File

@@ -11,7 +11,6 @@ import android.support.annotation.NonNull;
11 11
 import android.support.annotation.Nullable;
12 12
 
13 13
 import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
14
-import com.reactnativenavigation.BuildConfig;
15 14
 import com.reactnativenavigation.NavigationApplication;
16 15
 
17 16
 import java.io.FileNotFoundException;
@@ -72,8 +71,7 @@ public class ImageLoader {
72 71
             drawable = loadFile(source);
73 72
         } else {
74 73
             drawable = loadResource(source);
75
-
76
-            if (drawable == null || BuildConfig.DEBUG) {
74
+            if (drawable == null || NavigationApplication.instance.isDebug()) {
77 75
                 drawable = readJsDevImage(context, source);
78 76
             }
79 77
         }