aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAurash Mahbod <aurash@google.com>2013-06-09 13:30:04 -0700
committerAurash Mahbod <aurash@google.com>2013-06-09 13:30:04 -0700
commitaa6a5e69c646e8ef926a794a031ca4a9b5526a89 (patch)
treee31d111a4f7240b83c710a8b59cb4c2854b1c081 /src
parentc3dea925af9b3523e2e01e8b7799e71ef558c1c5 (diff)
downloadvolley-aa6a5e69c646e8ef926a794a031ca4a9b5526a89.tar.gz
Fix WRAP_CONTENT//WRAP_CONTENT case in NIV.
If the NIV is WRAP_CONTENT for both width / height, skip the check that makes sure that it is measured before fetching the image.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/volley/toolbox/NetworkImageView.java8
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;
}