/** Load the images into memory. */ public static void LoadImages(Context context) { if (images != null) { return; } images = new Bitmap[13]; Resources res = context.getResources(); images[2] = BitmapFactory.decodeResource(res, R.drawable.two); images[3] = BitmapFactory.decodeResource(res, R.drawable.three); images[4] = BitmapFactory.decodeResource(res, R.drawable.four); images[6] = BitmapFactory.decodeResource(res, R.drawable.six); images[8] = BitmapFactory.decodeResource(res, R.drawable.eight); images[9] = BitmapFactory.decodeResource(res, R.drawable.nine); images[12] = BitmapFactory.decodeResource(res, R.drawable.twelve); }
public IconHolder(Context context, boolean useThumbs, boolean grid) { super(); this.mContext = context; this.mUseThumbs = useThumbs; this.mRequests = new HashMap<ImageView, String>(); this.mIcons = new HashMap<String, Bitmap>(); this.mAppIcons = new LinkedHashMap<String, Bitmap>(MAX_CACHE, .75F, true) { private static final long serialVersionUID = 1L; @Override protected boolean removeEldestEntry(Entry<String, Bitmap> eldest) { return size() > MAX_CACHE; } }; this.mAlbums = new HashMap<String, Long>(); this.grid = grid; Resources res = mContext.getResources(); int dp = 50; if (grid) { dp = 150; } px = (int) (dp * (res.getDisplayMetrics().densityDpi / 160)); }
public MyView(Context context) { super(context); mBack = BitmapFactory.decodeResource(context.getResources(), R.drawable.family); mHandler.sendEmptyMessageDelayed(0, DELAY); }