Call Bitmap.recycle() to reduce the potential for OOMs.

On Android versions < 3 bitmaps are allocated from the native heap, and
ones that are no longer used are not collected with a normal Java GC,
leading to OOMs, especially on low-end devices.

Fix this with the interaction of three components -- a wrapper for
bitmaps that knows about caching, the image cache, and a new
CacheableImageView.  The wrapper maintains counters updated by both
the cache and the image view to determine when it's safe to call
Bitmap.recycle().

Based on work by Chris Banes, see
https://github.com/chrisbanes/Android-BitmapCache.
Merge branch 'master' into recycle-bitmap
Calculate the artwork icon size correctly.

Use getDimensionPixelSize() to fetch the resource's value instead of
using the resource ID value.
Calculate the artwork icon size correctly.

Use getDimensionPixelSize() to fetch the resource's value instead of
using the resource ID value.
Merge branch 'recycle-bitmap' of https://github.com/nikclayton/android-squeezer into recycle-bitmap

Conflicts:
	src/uk/org/ngo/squeezer/framework/SqueezerBaseListActivity.java
Set the memory image cache to 20% of the device memory.
Only add resized bitmaps to the memory cache, keep originals on disk.

Since the disk cache is shared between the activities that show
thumbnails and the "Now Playing" activity this ensures that the "Now
Playing" activity doesn't show resized thumbnails of the artwork,
while still benefiting from the disk cache.

Create addBitmapTo{Memory,Disk}Cache methods, reimplement addBitmapToCache
in terms of them, and only add the processed image to the memory cache.
Override onDraw(), handle recycled bitmaps.

onDraw() is occasionally called even after the bitmap has been recycled
(i.e., cache and imageview reference counts have dropped to zero).  This
shouldn't happen.

Handle it gracefully, otherwise an exception is thrown when the Canvas
tries to draw a recycled bitmap.
Manage the image cache over the activity lifecycle.

- Create the image fetcher and cache parameters once, in onCreate().

- Attach the cache to the image fetcher in onResume().

- Close the cache, removing it from the image fetcher, in onPause().
Handle bitmaps in LayerDrawables that might be recycled.

This should also catch the TransitionDrawable case.
Use v2.1 of the bitmap recycling code.

Pull in Chris Banes changes from v2.1 of his recycle-aware bitmap caching
library (https://github.com/chrisbanes/Android-BitmapCache/tree/v2.1).

Main changes:

- Wrap the cached bitmap in an extended BitmapDrawable.

- Handle bitmaps that have been cached but not yet displayed, to avoid
  a race condition.