Skip to content

Commit

Permalink
Merge pull request #9154 from garymathews/TIMOB-24842
Browse files Browse the repository at this point in the history
[TIMOB-24842] Android: Fix Ti.UI.View.opacity property change
  • Loading branch information
ssjsamir committed Jun 19, 2017
2 parents 1a7d2b5 + 19da0c7 commit 37b4e67
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,20 +830,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
applyTouchFeedback(bgColor, d.containsKey(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR) ? TiConvert.toColor(d, TiC.PROPERTY_TOUCH_FEEDBACK_COLOR) : null);
} else {
nativeView.setBackgroundColor(bgColor);
// A bug only on Android 2.3 (TIMOB-14311).
if (Build.VERSION.SDK_INT < TiC.API_LEVEL_HONEYCOMB && proxy.hasProperty(TiC.PROPERTY_OPACITY)) {
setOpacity(TiConvert.toFloat(proxy.getProperty(TiC.PROPERTY_OPACITY), 1f));
}
}
nativeView.postInvalidate();
}
} else {
if (key.equals(TiC.PROPERTY_OPACITY)) {
setOpacity(TiConvert.toFloat(newValue, 1f));
}
if (!nativeViewNull) {
nativeView.setBackgroundDrawable(null);
nativeView.postInvalidate();
}
}
} else {
Expand Down Expand Up @@ -889,14 +876,9 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
}

applyCustomBackground();

if (key.equals(TiC.PROPERTY_OPACITY)) {
setOpacity(TiConvert.toFloat(newValue, 1f));
} else if (Build.VERSION.SDK_INT < TiC.API_LEVEL_HONEYCOMB && proxy.hasProperty(TiC.PROPERTY_OPACITY)) {
// A bug only on Android 2.3 (TIMOB-14311).
setOpacity(TiConvert.toFloat(proxy.getProperty(TiC.PROPERTY_OPACITY), 1f));
}

}
if (key.equals(TiC.PROPERTY_OPACITY)) {
setOpacity(TiConvert.toFloat(newValue, 1f));
}
if (!nativeViewNull) {
nativeView.postInvalidate();
Expand Down

0 comments on commit 37b4e67

Please sign in to comment.