Skip to content

Commit

Permalink
Merge pull request #3756 from pingwang2011/timob-12379
Browse files Browse the repository at this point in the history
Timob 12379: Backport to 3_0_X: TIMOB-12362
  • Loading branch information
ayeung committed Jan 23, 2013
2 parents ff65bf7 + 6a5776c commit bcf4254
Showing 1 changed file with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,8 @@ public void handleStop()
fireStop();
}

private void setImageSource(Object object, boolean sameSource)
private void setImageSource(Object object)
{
if (imageViewProxy.inTableView() && sameSource && imageSources != null) {
return;
}

imageSources = new ArrayList<TiDrawableReference>();
if (object instanceof Object[]) {
for (Object o : (Object[]) object) {
Expand Down Expand Up @@ -839,7 +835,7 @@ public void processProperties(KrollDict d)
}

if (d.containsKey(TiC.PROPERTY_IMAGES)) {
setImageSource(d.get(TiC.PROPERTY_IMAGES), false);
setImageSource(d.get(TiC.PROPERTY_IMAGES));
setImages();
}
if (d.containsKey(TiC.PROPERTY_CAN_SCALE)) {
Expand Down Expand Up @@ -918,21 +914,17 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
} else if (key.equals(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)) {
view.setEnableZoomControls(TiConvert.toBoolean(newValue));
} else if (key.equals(TiC.PROPERTY_IMAGE)) {
if (oldValue.equals(newValue)) {
setImageSource(newValue, true);
} else {
setImageSource(newValue, false);
if ((oldValue == null && newValue != null) || (oldValue != null && !oldValue.equals(newValue))) {
setImageSource(newValue);
firedLoad = false;
setImage(true);
}
firedLoad = false;
setImage(true);
} else if (key.equals(TiC.PROPERTY_IMAGES)) {
if (newValue instanceof Object[]) {
if (oldValue.equals(newValue)) {
setImageSource(newValue, true);
} else {
setImageSource(newValue, false);
if (oldValue == null || !oldValue.equals(newValue)) {
setImageSource(newValue);
setImages();
}
setImages();
}
} else {
// Update requestedWidth / requestedHeight when width / height is changed.
Expand Down

0 comments on commit bcf4254

Please sign in to comment.