Example #1
0
  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));
  }