Skip to content

Commit

Permalink
Merge pull request #2553 from hieupham007/timob-8774-2_1_X
Browse files Browse the repository at this point in the history
Timob 8774-2_1_X: Fixed label disappearance
  • Loading branch information
ayeung committed Jul 12, 2012
2 parents c9269e7 + dcd4a8f commit 57cf291
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ private Pair<String, String> updateLocaleProperty(String localeProperty, String
if (entry.getValue().toString().equals(localeProperty)) {
String targetProperty = entry.getKey();
String localizedValue = getLocalizedText(newLookupId);
if (localizedValue == null) {
return null;
}
setProperty(targetProperty, localizedValue);

return Pair.create(targetProperty, localizedValue);
Expand Down Expand Up @@ -350,10 +353,14 @@ private String getLocalizedText(String lookupId)
{
try {
int resid = TiRHelper.getResource("string." + lookupId);
return getActivity().getString(resid);
if (resid != 0) {
return getActivity().getString(resid);
}
return null;

} catch (TiRHelper.ResourceNotFoundException e) {
return null;
}
}
}

/**
Expand Down Expand Up @@ -703,7 +710,9 @@ public void onPropertyChanged(String name, Object value)

Object oldValue = properties.get(propertyName);
properties.put(propertyName, newValue);
firePropertyChanged(propertyName, oldValue, newValue);
if (shouldFireChange(oldValue, newValue)) {
firePropertyChanged(propertyName, oldValue, newValue);
}
}

public void onPropertiesChanged(Object[][] changes)
Expand Down

0 comments on commit 57cf291

Please sign in to comment.