Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25253] Windows: backgroundGradient should have a default startPoint and endPoint

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-09-12T13:31:31.000+0000
Affected Version/sRelease 6.1.2, Release 7.0.0, Release 6.2.0
Fix Version/sRelease 7.5.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-09-08T09:59:47.000+0000
Updated2018-09-18T10:03:12.000+0000

Description

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

Comments

  1. Kota Iguchi 2018-08-08

    https://github.com/appcelerator/titanium_mobile_windows/pull/1279
  2. Samir Mohammed 2018-09-12

    *FR passed* waiting on Master branch.
  3. Samir Mohammed 2018-09-18

    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

JSON Source