Code example for BlockingQueue

Methods: offer

        if (!large) {
            setUnknownImage(view, large);
        queue.offer(new Task(view, entry, size, large, large, crossfade));
    private String getKey(String coverArtId, int size) {
        return coverArtId + size;
    private void setImage(View view, Drawable drawable, boolean crossfade) {
        if (view instanceof TextView) {
            // Cross-fading is not implemented for TextView since it's not in use.  It would be easy to add it, though. 
            TextView textView = (TextView) view;
            textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
        } else if (view instanceof ImageView) {
            ImageView imageView = (ImageView) view;
            if (crossfade) {