diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/WPImageGetter.java b/WordPressUtils/src/main/java/org/wordpress/android/util/WPImageGetter.java index 1d7a73010e08..2db72116337e 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/WPImageGetter.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/WPImageGetter.java @@ -92,27 +92,18 @@ public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) return; } - final int oldHeight = remote.getBounds().height(); int maxWidth = view.getWidth() - view.getPaddingLeft() - view.getPaddingRight(); if (mMaxSize > 0 && (maxWidth > mMaxSize || maxWidth == 0)) { maxWidth = mMaxSize; - AppLog.d(T.UTILS, "WPImageGetter setting maxWidth = mMaxSize"); } Drawable drawable = new BitmapDrawable(view.getContext().getResources(), response.getBitmap()); remote.setRemoteDrawable(drawable, maxWidth); - // image is from cache? don't need to modify view height - if (isImmediate) { - AppLog.d(T.UTILS, "WPImageGetter isImmediate"); - return; + // force textView to resize correctly if image isn't cached + if (!isImmediate) { + view.setText(view.getText()); } - - // invalidate the textView so the image redraws - view.invalidate(); - - int newHeight = remote.getBounds().height(); - view.setHeight(view.getHeight() + newHeight - oldHeight); } });