public Builder(Context context) { this.context = context; activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); screenDimensions = new DisplayMetricsScreenDimensions(context.getResources().getDisplayMetrics()); // On Android O+ Bitmaps are allocated natively, ART is much more efficient at managing // garbage and we rely heavily on HARDWARE Bitmaps, making Bitmap re-use much less important. // We prefer to preserve RAM on these devices and take the small performance hit of not // re-using Bitmaps and textures when loading very small images or generating thumbnails. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isLowMemoryDevice(activityManager)) { bitmapPoolScreens = 0; } }
public Builder(Context context) { this.context = context; activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); screenDimensions = new DisplayMetricsScreenDimensions(context.getResources().getDisplayMetrics()); // On Android O+ Bitmaps are allocated natively, ART is much more efficient at managing // garbage and we rely heavily on HARDWARE Bitmaps, making Bitmap re-use much less important. // We prefer to preserve RAM on these devices and take the small performance hit of not // re-using Bitmaps and textures when loading very small images or generating thumbnails. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isLowMemoryDevice(activityManager)) { bitmapPoolScreens = 0; } }
public MemorySizeCalculator(Context context) { this(context, (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE), new DisplayMetricsScreenDimensions(context.getResources().getDisplayMetrics())); }