add half image resizing

Changed to implicit casting, don't know why I didn't think that'd work.

Good catch

On Wed, Oct 8, 2014 at 9:10 AM, Jenny Schweers <notifications@github.com>
wrote:

> In src/org/odk/collect/android/views/ResizingImageView.java:
>
> > +                        float dWidth = dipToPixels(getContext(), drawable.getIntrinsicWidth());
> > +                        float dHeight = dipToPixels(getContext(), drawable.getIntrinsicHeight());
> > +                        float ratio = (dWidth) / dHeight;
> > +
> > +                        int width = (int) Math.min(Math.max(dWidth, getSuggestedMinimumWidth()), maxWidth);
> > +                        int height = (int) (width / ratio);
> > +
> > +                        height = Math.min(Math.max(height, getSuggestedMinimumHeight()), maxHeight);
> > +                        width = (int) (height * ratio);
> > +
> > +                        if (width > maxWidth) {
> > +                            width = maxWidth;
> > +                            height = (int) (width / ratio);
> > +                        }
> > +
> > +                        Pair<Integer,Integer> mPair = new Pair<Integer,Integer>(new Double(width * scaleFactor).intValue(), new Double(height * scaleFactor).intValue());
>
> Minor, but "new Double(width * scaleFactor).intValue()" is a weird way to
> get an Integer. Why not just "width * scaleFactor"?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dimagi/opendatakit.collect/pull/39/files#r18580590>.
>