Description
Defining a backgroundGradient without a startPoint or endPoint should default to a value
Docs:
https://github.com/appcelerator/titanium_mobile/blob/6f50122643f87a89523bf27af3186f597a9a55df/apidoc/Titanium/UI/View.yml#L1788
Android:
https://github.com/appcelerator/titanium_mobile/blob/a8aceeaeee02ed9c8ea70c835a0e78960e254a55/android/titanium/src/java/org/appcelerator/titanium/view/TiGradientDrawable.java#L29
iOS (I think):
https://github.com/appcelerator/titanium_mobile/blob/8ab7ac87ef1663c4cd8b50afc59b3bea72f31d53/iphone/Classes/TiGradient.m#L210-L215
Note that on Android the value stated in the docs doesn't give them same outcome as the default value, below is what obtains the default on Android It does work as expected on Windows
var _window = Ti.UI.createWindow();
var buttonAddFav = Titanium.UI.createButton({
title: 'add2favs',
backgroundGradient: {
type: 'linear',
startPoint: {x: 0.0, y: 0.0},
endPoint: {x: 0.0, y: "100%"},
colors: [{ color: '#aaa', offset: 0.0 }, { color: '#f00', offset: 0.25 }]
}
});
_window.add(buttonAddFav);
_window.open()
Steps to reproduce
Add the above to an app.js and build for Windows
Comment out startPoint and endPoint
Actual
After commenting the values out the gradient disappears
Expected
The gradient should stay the same after commenting the values out
https://github.com/appcelerator/titanium_mobile_windows/pull/1279
*FR passed* waiting on Master branch.
Closing ticket. Fix verified in SDK version 7.5.0.v20180917031523. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1279