Top Banner
Sencha Touch Intro Web Based Native(ish) Apps
43

Sencha Touch Intro

Jan 13, 2015

Download

Documents

Shea Frederick

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sencha Touch Intro

Sencha Touch IntroWeb Based Native(ish) Apps

Page 2: Sencha Touch Intro
Page 3: Sencha Touch Intro
Page 4: Sencha Touch Intro
Page 5: Sencha Touch Intro

Setup Viewport Data View

Page 6: Sencha Touch Intro

Setup

Page 7: Sencha Touch Intro

Download The SDK

• Extract contents• Grab the CSS files from resources/css folder• Grab the JS files from the root folder

Page 8: Sencha Touch Intro

Create Base HTML

<html><head><title>BmoreJS Mobile</title></head><body></body></html>

Page 9: Sencha Touch Intro

Include CSS & JS

    <link type="text/css" rel="stylesheet" href="sencha-touch-debug.css">    <script type="application/javascript" src="sencha-touch-debug.js"></script>

Page 10: Sencha Touch Intro

Setup The Aplication

    <script type="application/javascript">    Ext.regApplication({        name: 'BmoreJS',        phoneStartupScreen: 'phone-startup.png',        phoneIcon: 'apple-touch-icon.png',        launch: function(){}     });    </script>

Page 11: Sencha Touch Intro

Setup The Aplication

    <script type="application/javascript">    Ext.regApplication({        name: 'BmoreJS',        phoneStartupScreen: 'phone-startup.png',        phoneIcon: 'apple-touch-icon.png',        launch: function(){}     });    </script>

Page 12: Sencha Touch Intro

Setup The Aplication

    <script type="application/javascript">    Ext.regApplication({        name: 'BmoreJS',        phoneStartupScreen: 'phone-startup.png',        phoneIcon: 'apple-touch-icon.png',        launch: function(){}     });    </script>

Page 13: Sencha Touch Intro

320x460

Page 14: Sencha Touch Intro

http://tinyurl.com/iosicon

57x57

Page 15: Sencha Touch Intro

Setup The Aplication

    <script type="application/javascript">    Ext.regApplication({        name: 'BmoreJS',        phoneStartupScreen: 'phone-startup.png',        phoneIcon: 'apple-touch-icon.png',        launch: function(){}     });    </script>

Page 16: Sencha Touch Intro

Viewport

Page 17: Sencha Touch Intro

Create The Viewport

    <script type="application/javascript">    ...        launch: function(){            this.viewport = new Ext.Panel({                 fullscreen: true            });        }     ...    </script>

Page 18: Sencha Touch Intro

Create The Viewport

    <script type="application/javascript">    ...        launch: function(){            this.viewport = new Ext.Panel({                 fullscreen: true            });        }     ...    </script>

Page 19: Sencha Touch Intro

Create The Viewport

    <script type="application/javascript">    ...        launch: function(){            this.viewport = new Ext.Panel({                 fullscreen: true            });        }     ...    </script>

Page 20: Sencha Touch Intro

Create The Viewport

    <script type="application/javascript">    ...        launch: function(){            this.viewport = new Ext.Panel({                 fullscreen: true            });        }     ...    </script>

Page 21: Sencha Touch Intro
Page 22: Sencha Touch Intro

Docked Items

       this.viewport = new Ext.Panel({            fullscreen: true,            dockedItems: [{                xtype: "toolbar",                dock: "top",                title: 'BmoreJS'            }]       });

Page 23: Sencha Touch Intro
Page 24: Sencha Touch Intro

Buttons

            dockedItems: [{                xtype: "toolbar",                ...                items: [{                    ui: 'back',                    text: 'back',                    handler: function(){}                }]            }]

Page 25: Sencha Touch Intro
Page 26: Sencha Touch Intro

Button UI

            dockedItems: [{                xtype: "toolbar",                ...                items: [{                    ui: 'back',                    text: 'back',                    handler: function(){}                }]            }]

Page 27: Sencha Touch Intro

Standard Button UI's

Color Variations

confirm                                         decline

Page 28: Sencha Touch Intro

Data

Page 29: Sencha Touch Intro

Data

StoreModel

Reader Proxy Source

Page 30: Sencha Touch Intro

Model

    Ext.regModel('Statuses', {        fields: ['id_str','text']    });

Page 31: Sencha Touch Intro

Model

    Ext.regModel('Statuses', {        fields: ['id_str','text']    });

Page 32: Sencha Touch Intro

Model

    Ext.regModel('Statuses', {        fields: ['id_str','text']    });

Page 33: Sencha Touch Intro

Store    BmoreJS.stores.Statuses = new Ext.data.Store({        model: 'Statuses',        proxy: {            type: 'scripttag',            url: 'http://api.twitter.com/1/statuses/user_timeline.json',            extraParams: {              screen_name: 'bmorejs'            }        },        autoLoad: true    });

Page 34: Sencha Touch Intro

Store    BmoreJS.stores.Statuses = new Ext.data.Store({        model: 'Statuses',        proxy: {            type: 'scripttag',            url: 'http://api.twitter.com/1/statuses/user_timeline.json',            extraParams: {              screen_name: 'bmorejs'            }        },        autoLoad: true    });

Page 35: Sencha Touch Intro

Store    BmoreJS.stores.Statuses = new Ext.data.Store({        model: 'Statuses',        proxy: {            type: 'scripttag',            url: 'http://api.twitter.com/1/statuses/user_timeline.json',            extraParams: {              screen_name: 'bmorejs'            }        },        autoLoad: true    });

Page 36: Sencha Touch Intro

View

Page 37: Sencha Touch Intro

The List

            this.viewport = new Ext.Panel({                layout: 'fit',                ...                items: [{                    xtype: 'list',                    itemTpl: '{text}',                    store: BmoreJS.stores.Statuses                }]                ...            });

Page 38: Sencha Touch Intro

The List

            this.viewport = new Ext.Panel({                layout: 'fit',                ...                items: [{                    xtype: 'list',                    itemTpl: '{text}',                    store: BmoreJS.stores.Statuses                }]                ...            });

Page 39: Sencha Touch Intro

The List

            this.viewport = new Ext.Panel({                layout: 'fit',                ...                items: [{                    xtype: 'list',                    itemTpl: '{text}',                    store: BmoreJS.stores.Statuses                }]                ...            });

Page 40: Sencha Touch Intro

The List

            this.viewport = new Ext.Panel({                layout: 'fit',                ...                items: [{                    xtype: 'list',                    itemTpl: '{text}',                    store: BmoreJS.stores.Statuses                }]                ...            });

Page 41: Sencha Touch Intro

Templates

itemTpl: '<a href="{url}"><img src="{img}">{text}</a>',

Page 42: Sencha Touch Intro

The List

            this.viewport = new Ext.Panel({                layout: 'fit',                ...                items: [{                    xtype: 'list',                    itemTpl: '{text}',                    store: BmoreJS.stores.Statuses                }]                ...            });

Page 43: Sencha Touch Intro