diff options
author | Ficus Kirkpatrick <ficus@android.com> | 2013-06-10 17:03:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-06-10 17:03:23 +0000 |
commit | 1f09db94cdaae7821feabfb479d91ba182ae45be (patch) | |
tree | 23d5201e6d8bf3f5746805ea9439ad8c8e87036a /src | |
parent | d843f88166f5a1a099cfc9ff35473b31b50b18af (diff) | |
parent | aa6a5e69c646e8ef926a794a031ca4a9b5526a89 (diff) | |
download | volley-1f09db94cdaae7821feabfb479d91ba182ae45be.tar.gz |
Merge "Fix WRAP_CONTENT//WRAP_CONTENT case in NIV."
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/volley/toolbox/NetworkImageView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/volley/toolbox/NetworkImageView.java b/src/com/android/volley/toolbox/NetworkImageView.java index 0d1d6be..d4f14e9 100644 --- a/src/com/android/volley/toolbox/NetworkImageView.java +++ b/src/com/android/volley/toolbox/NetworkImageView.java @@ -19,6 +19,7 @@ import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.widget.ImageView; +import android.widget.LinearLayout.LayoutParams; import com.android.volley.VolleyError; import com.android.volley.toolbox.ImageLoader.ImageContainer; @@ -103,8 +104,11 @@ public class NetworkImageView extends ImageView { int width = getWidth(); int height = getHeight(); - // if the view's bounds aren't known yet, hold off on loading the image. - if (width == 0 && height == 0) { + boolean isFullyWrapContent = getLayoutParams().height == LayoutParams.WRAP_CONTENT + && getLayoutParams().width == LayoutParams.WRAP_CONTENT; + // if the view's bounds aren't known yet, and this is not a wrap-content/wrap-content + // view, hold off on loading the image. + if (width == 0 && height == 0 && !isFullyWrapContent) { return; } |