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

Android: Support Animation of backgroundColor

    Details

      Description

      add ability to animate backgroundColor. Note the view MUST have a backgroundColor and no backgroundImages for this to work.

      app.js

       
      Ti.UI.setBackgroundColor('black');
       
      var win = Ti.UI.createWindow({
      	backgroundColor: 'black'
      });
       
      var fromColor = '#2d6e32';
      var toColor = '#35883b';
       
      var v = Ti.UI.createView({
      	width: '100dp',
      	height: '100dp',
      	backgroundColor: fromColor
      });
       
      var b = Ti.UI.createButton({
      	title: 'Animate',
      	bottom: '10dp',
      	left: '10dp'
      });
       
      b.addEventListener('click', function() {
      	v.animate({
      		backgroundColor: toColor,
      		duration: 500
      	});
      });
       
      var b1 = Ti.UI.createButton({
      	title: 'Reset',
      	bottom: '10dp',
      	right: '10dp'	
      });
       
      b1.addEventListener('click', function() {
      	v.backgroundColor = toColor;
      	v.backgroundColor = fromColor;
      });
       
      var v1 = Ti.UI.createView({
      	width : '50dp',
      	height: '50dp',
      	backgroundColor: 'white'
      });
       
      win.add(v);
      win.add(b);
      win.add(b1);
      win.add(v1);
       
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dthorp Don Thorp
                Reporter:
                dthorp Don Thorp
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code