Skip to content

Commit

Permalink
Merge pull request #3689 from hieupham007/timob-11762
Browse files Browse the repository at this point in the history
timob-11762: imageView should update images correctly
  • Loading branch information
pingwang2011 committed Jan 11, 2013
2 parents 4e74ade + 97a4612 commit 90470da
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,14 +683,10 @@ public void handleStop()
fireStop();
}

private void setImageSource(Object object)
private void setImageSource(Object object, boolean sameSource)
{
if (imageViewProxy.inTableView()) {
ArrayList<TiDrawableReference> currentSources = imageViewProxy.getImageSources();
if (currentSources != null) {
imageSources = currentSources;
return;
}
if (imageViewProxy.inTableView() && sameSource && imageSources != null) {
return;
}

imageSources = new ArrayList<TiDrawableReference>();
Expand Down Expand Up @@ -960,7 +956,7 @@ public void processProperties(KrollDict d)
}

if (d.containsKey(TiC.PROPERTY_IMAGES)) {
setImageSource(d.get(TiC.PROPERTY_IMAGES));
setImageSource(d.get(TiC.PROPERTY_IMAGES), false);
setImages();
}
if (d.containsKey(TiC.PROPERTY_CAN_SCALE)) {
Expand Down Expand Up @@ -1039,12 +1035,20 @@ 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)) {
setImageSource(newValue);
if (oldValue.equals(newValue)) {
setImageSource(newValue, true);
} else {
setImageSource(newValue, false);
}
firedLoad = false;
setImage(true);
} else if (key.equals(TiC.PROPERTY_IMAGES)) {
if (newValue instanceof Object[]) {
setImageSource(newValue);
if (oldValue.equals(newValue)) {
setImageSource(newValue, true);
} else {
setImageSource(newValue, false);
}
setImages();
}
} else {
Expand Down

0 comments on commit 90470da

Please sign in to comment.