Sample.Todo icon indicating copy to clipboard operation
Sample.Todo copied to clipboard

No add Todo on android

Open comptekki opened this issue 12 years ago • 2 comments

There doesn't seem to be a button created to Add a Todo on Android. The code for this is skipped (or is just for iOS and mobile web) and there is no other code to do it. Does this app just set an Item to Done or Delete only for android apps??

comptekki avatar Feb 22 '13 05:02 comptekki

It's not actually a button, but a menu option. onCreateOptionsMenu in apps.js is not being called. See also: http://developer.appcelerator.com/question/150406/missing-add-button-in-the-todo-list-titanium-mobile-sample-app#comment-166274

jakubczaplicki avatar Apr 04 '13 10:04 jakubczaplicki

A year later I'm still seeing this issue on Android devices. For anyone wanting a quick & dirty fix, add the following code to the /Resources/ui/ListWindow.js file, after line 37 (after the if(platform !== 'android'){} statement):

   else {
            var addBtn = Ti.UI.createButton({
                title:'+ Add Task',
                color:'#808080',
                height:40,
                width:'50%',
                top:'80%',
                right:'25%'
            });
            self.add(addBtn);

            addBtn.addEventListener('click', function() {
                new AddWindow().open();
            });
        }

This will create a simple button at the bottom of the TODO screen, it will activate the add task function.

jalakoo avatar Apr 04 '14 18:04 jalakoo