Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>PhoneGap allows you to use your existing knowledge of HTML, CSS, and JavaScript to create useful and exciting mobile applications.<br /><br />This book will present you with 12 exciting projects that will introduce you to the dynamic world of app development in PhoneGap. Starting with their design and following through to their completion, you will develop real-world mobile applications. Each app uses a combination of core PhoneGap technologies, plugins, and various frameworks covering the necessary concepts you can use to create many more great apps for mobile devices.</p>
Table of Contents (21 chapters)
PhoneGap 3.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing the user interface


We've done a lot so far and are not quite done. We still need to implement a couple of changes in the note view factory, alter the note list view, and implement the new audio note edit view.

Getting on with it

The first thing we need to do is alter our note view factory in www/app/js/noteViewFactory.js. Add the following to the switch statement prior to the default case:

         case noteFactory.AUDIONOTE:
            return new AudioNoteEditView();

Next, let's make the requisite changes to the note list view in www/js/app/noteListView.js. We need to add a method to create a new audio note and hook that up with an event listener to the sound wave icon on the toolbar. We also need to replace our previous event handlers with Hammer.js gesture support. We also need to add swipe-to-delete support. Finally, we need to use YASMF's navigation controller for view management.

The following is what our revised model looks like (new methods in bold):

First, we added a reference...