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 6 years ago
parent
commit
b422dd0761

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

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