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

Android: Map:View:'Animate' is also a function as per docs, but app is treating it as a property

    Details

      Description

      This is not a regression. It exists as far as 1.8.2.
      Issue - While running the app, it gives error "Property 'animate' of object #<View> is not a function". As per docs, it is also a method. This issue does not comes in iOS. There it works as expected.

      Steps to reproduce:
      1) Use the code below

      var win = Ti.UI.createWindow();
           
          var scrollView = Ti.UI.createScrollView({
              contentHeight: 'auto',
              contentWidth: 'auto',
              layout:'vertical', //Change from default value from absolute to a relative distance between the sibling views
              scrollType:"vertical",
              top: 0,
              showVerticalScrollIndicator: true,
              showHorizontalScrollIndicator: false
          }); 
           
          var mapView = Ti.Map.createView({
              mapType: Ti.Map.STANDARD_TYPE,
              height: 150,
              top:0,
              animate:true,
              regionFit:true,
              userLocation:true,
              annotations:[]
          });
           
          var resizeBtn = Ti.UI.createButton({
              title:"resize map",
              width:100,
              height:44,
              right:5,
              bottom:5
          });
          var mapToggle = false;
          resizeBtn.addEventListener("click", function(e){
              mapToggle = !mapToggle;
              if(mapToggle){
                  mapView.animate({height:250, duration:300});
              } else {
                  mapView.animate({height:150, duration:300});
              }
          });
          mapView.add(resizeBtn);
          scrollView.add(mapView);
           
          //other content
          var testView = Ti.UI.createView({top:0, height:200, width:300, backgroundColor:"red"});
           
          var resize2Btn = Ti.UI.createButton({
              title:"resize view",
              width:120,
              height:44,
              right:5,
              bottom:5
          });
          var toggle = false;
          resize2Btn.addEventListener("click", function(e){
              toggle = !toggle;
              if(toggle){
                  testView.animate({height:300, duration:300});
              } else {
                  testView.animate({height:200, duration:300});
              }
          });
          testView.add(resize2Btn);
          scrollView.add(testView);
           
          //other content
          scrollView.add(Ti.UI.createView({top:0, height:200, width:300, backgroundColor:"blue"}));
           
          win.add(scrollView);
           
      win.open();
      

      2) Click the button 'resize map'

      Actual result
      1) After step 2,a runtime error is shown stating property 'animate' of object #<View> is not a function.

      Expected result
      1) Animate should also be treated as a function (as per docs).

        Attachments

          Activity

            People

            • Assignee:
              billdawson Bill Dawson
              Reporter:
              sbhadauria Shyam Bhadauria
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration