Throw an exception when creating bitmaps with invalid dimensions.

Closes #1197.
Implement ShadowView.getOnCreateContextMenuListener.

Fixes #1194. Closes #1195.