Add debug setting to enable Picasso indicators

This commit is contained in:
Stypox 2021-03-27 14:59:24 +01:00
parent 314964c5f9
commit 52189fc5df
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
6 changed files with 34 additions and 6 deletions

View file

@ -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();

View file

@ -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;
}