@Override
        protected TextView updateDrawable(final Drawable newDrawable) {
            final TextView view = super.updateDrawable(newDrawable);
            if (view != null) {
                setBounds(scaleImageToLineHeight(newDrawable, view));
            }
            return view;
        }
Image that automatically scales to fit a line of text in the containing {@link TextView}.
main/src/main/java/cgeo/geocaching/utils/ImageUtils.java