Add debug setting to enable Picasso indicators
This commit is contained in:
parent
314964c5f9
commit
52189fc5df
6 changed files with 34 additions and 6 deletions
|
|
@ -100,9 +100,12 @@ public class App extends MultiDexApplication {
|
|||
ServiceHelper.initServices(this);
|
||||
|
||||
// Initialize image loader
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
PicassoHelper.init(this);
|
||||
PicassoHelper.setShouldLoadImages(PreferenceManager.getDefaultSharedPreferences(this)
|
||||
.getBoolean(getString(R.string.download_thumbnail_key), true));
|
||||
PicassoHelper.setShouldLoadImages(
|
||||
prefs.getBoolean(getString(R.string.download_thumbnail_key), true));
|
||||
PicassoHelper.setIndicatorsEnabled(BuildConfig.DEBUG
|
||||
&& prefs.getBoolean(getString(R.string.show_image_indicators_key), false));
|
||||
|
||||
configureRxJavaErrorHandler();
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ public final class PicassoHelper {
|
|||
picassoInstance.cancelTag(tag);
|
||||
}
|
||||
|
||||
public static void setIndicatorsEnabled(final boolean enabled) {
|
||||
picassoInstance.setIndicatorsEnabled(enabled); // useful for debugging
|
||||
}
|
||||
|
||||
public static void setShouldLoadImages(final boolean shouldLoadImages) {
|
||||
PicassoHelper.shouldLoadImages = shouldLoadImages;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue