File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,23 +125,18 @@ public void onCreate() {
125125 @ NonNull
126126 @ Override
127127 public ImageLoader newImageLoader () {
128- final var isLowRamDevice = ContextCompat .getSystemService (this , ActivityManager .class )
129- .isLowRamDevice ();
130- final var builder = new ImageLoader .Builder (this )
128+ return new ImageLoader .Builder (this )
131129 .memoryCache (() -> new MemoryCache .Builder (this )
132130 .maxSizeBytes (10 * 1024 * 1024 )
133131 .build ())
134132 .diskCache (() -> new DiskCache .Builder ()
135133 .directory (new File (getExternalCacheDir (), "coil" ))
136134 .maxSizeBytes (50 * 1024 * 1024 )
137135 .build ())
138- .allowRgb565 (isLowRamDevice );
139-
140- if (MainActivity .DEBUG ) {
141- builder .logger (new DebugLogger ());
142- }
143-
144- return builder .build ();
136+ .allowRgb565 (ContextCompat .getSystemService (this , ActivityManager .class )
137+ .isLowRamDevice ())
138+ .logger (BuildConfig .DEBUG ? new DebugLogger () : null )
139+ .build ();
145140 }
146141
147142 protected Downloader getDownloader () {
You can’t perform that action at this time.
0 commit comments