use of com.nostra13.universalimageloader.core.assist.ImageSize in project Android-Universal-Image-Loader by nostra13.
the class ImageLoaderConfiguration method getMaxImageSize.
ImageSize getMaxImageSize() {
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
int width = maxImageWidthForMemoryCache;
if (width <= 0) {
width = displayMetrics.widthPixels;
}
int height = maxImageHeightForMemoryCache;
if (height <= 0) {
height = displayMetrics.heightPixels;
}
return new ImageSize(width, height);
}
use of com.nostra13.universalimageloader.core.assist.ImageSize in project QiDict by timqi.
the class MainActivity method setBackgroundColor.
private void setBackgroundColor(int bgNum) {
int[] bgArr = new int[] { 0, R.drawable.bg1, R.drawable.bg2, R.drawable.bg3, R.drawable.bg4, R.drawable.bg5, R.drawable.bg6, R.drawable.bg7, R.drawable.bg8, R.drawable.bg9, R.drawable.bg10, R.drawable.bg11, R.drawable.bg12 };
String imgUri = "drawable://" + bgArr[bgNum];
ImageSize imageSize = new ImageSize(mRelativeLayout.getWidth(), mRelativeLayout.getHeight());
Bitmap bitmap = ImageLoader.getInstance().loadImageSync(imgUri, imageSize);
mRelativeLayout.setBackgroundDrawable(new BitmapDrawable(bitmap));
}
Aggregations