Add view attach/detach callbacks for RecyclerView adapters

Offer a chance for an adapter to do more fine-grained resource
management and tracking as views are added and removed from the
layout. This lets adapters check if a view was actually attached to a
window vs. just speculatively measured as well as control more of the
caching process if item views come with large bitmaps, etc. attached.

Lower the default offscreen view cache size. Offer a public setter for
the cache size.

Change-Id: Idb2a5e8ab5a84a1e35d46dc261f2ff264cee0624
1 file changed