Skip to content

Commit

Permalink
Use chaining that makes lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
emartynov authored and florina-muntenescu committed Dec 20, 2019
1 parent b3e0473 commit 7674959
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class PlaidGlideModule extends AppGlideModule {

@Override
public void applyOptions(Context context, GlideBuilder builder) {
final RequestOptions defaultOptions = new RequestOptions();
// Prefer higher quality images unless we're on a low RAM device
ActivityManager activityManager =
(ActivityManager) context.getSystemService(ACTIVITY_SERVICE);
defaultOptions.format(activityManager.isLowRamDevice() ? PREFER_RGB_565 : PREFER_ARGB_8888);
// Disable hardware bitmaps as they don't play nicely with Palette
defaultOptions.disallowHardwareConfig();
final RequestOptions defaultOptions = new RequestOptions()
.format(activityManager.isLowRamDevice() ? PREFER_RGB_565 : PREFER_ARGB_8888)
// Disable hardware bitmaps as they don't play nicely with Palette
.disallowHardwareConfig();
builder.setDefaultRequestOptions(defaultOptions);
}

Expand Down

0 comments on commit 7674959

Please sign in to comment.