Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25253

Windows: backgroundGradient should have a default startPoint and endPoint

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.2, Release 7.0.0, Release 6.2.0
    • Fix Version/s: Release 7.5.0
    • Component/s: Windows
    • Labels:
      None
    • Environment:

      Ti SDK: 6.1.2.GA, 6.2.0.v20170906064110, 7.0.0.v20170906135653

    • Story Points:
      8
    • Sprint:
      2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK

      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
      1. Add the above to an app.js and build for Windows
      2. 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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                eharris Ewan Harris
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-11121
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code