ݺߣ

ݺߣShare a Scribd company logo
???? ??? ?? ??
                    ????? ??? ???




12? 11? 8? ???
motivation


12? 11? 8? ???
9 month ago


12? 11? 8? ???
???
                 Dong9.org




12? 11? 8? ???
12? 11? 8? ???
1. Modal Layer


                            ??? ??? ????
                                  ?????!




12? 11? 8? ???
????? ????...
                        ???? ???? ?? ????.




12? 11? 8? ???
??? ?,....
                    ?? ??? ???? ??? ??? ??.




12? 11? 8? ???
??? ??,
                           ??? ?? ?? ???,

                           ? ?? ???? ?? ?? ???.



                           var view = Ti.UI.createView({
                             opacity: 0.5
                           });

                           var layerView = Ti.UI.createView();
                           view.add(layerView);
                           view.show();




12? 11? 8? ???
??? ??? ??!


                          ?? ?? opacity? ?? ??? ???
                  ??~~~   ???.




12? 11? 8? ???
??? ??,
                           ??? ?? ?? ???,

                           ? ?? ?? ??? ???? ?? ???.



                           var view = Ti.UI.createView({
                             opacity: 0.5
                           });
                           win.add(view);

                           var layerView = Ti.UI.createView();
                           win.add(layerView);
                           view.show();
                           layerView.show();




12? 11? 8? ???
??? ??? ??!


                          ??? ?????,

                          ?? ???? ?? ???? UI? ??? ?
                  ??~~~   ??.




12? 11? 8? ???
Solution!
                 function Layer() {
                 	 var dimmed = Ti.UI.createWindow({opacity:0.5, zIndex:1});
                 	 var content = Ti.UI.createWindow({zIndex:2});

                 	    this.open = function(){
                          dimmed.open();
                          content.open();
                 	    };
                      ...
                      ?? ??
                                                ???? ??? ???,
                      ...
                 	    return this;              ??? ??? ???!
                 };

                 module.exports = Layer




12? 11? 8? ???
2. Designed TabGroup


                  ?? ???
                 ? ?? ???




12? 11? 8? ???
???? ?? ??? ?? ??? ???




12? 11? 8? ???
memories of the layer

                           ??, ?? ??? ???.




12? 11? 8? ???
memories of the layer

                           ??, ?? ??? ???.


                           var tabGroup = Ti.UI.createTabGroup();
                           var win1 = Ti.UI.createWindow({
                             tabBarHidden : true
                           });
                           var tab = Ti.UI.createTab({window: win1});
                           tabGroup.addTab(tab);




12? 11? 8? ???
memories of the layer

                              ??? ???? ???.


                             64x48 ??? ?? 5??

                             ??? ??? ?? ?? ??? ?? ?????.


                             20 px
                             48 px

                     64 px




12? 11? 8? ???
memories of the layer

                                         ??? ????,
                              ???? ???? ????.

                             button.addEventListener("click", function(e) {

                                  // ?? ?? ??
                                  oTabGroup.setActiveTab(e.source.index);

                             })

                              20 px
                              48 px

                     64 px




12? 11? 8? ???
memories of the layer


                               ???? ????,
                                 currentT .open();
                            Ti.UI.       ab
                                     ??? ??? ????!




12? 11? 8? ???
3. Layout


                 ??? ????
                   ????




12? 11? 8? ???
Three layout properties

                     composite (Default)
                           vertical
                         horizontal




12? 11? 8? ???
Composite layout
                             ?? ?? ????
                             ??? ????
                             ???? ???.


                           ?, ???? ???
                               ????


12? 11? 8? ???
Vertical layout

                      1       ??? ??? ??? ????
                                   ???? ???,


                                   ??? ????
                              ?? ?? ?? ??? ????
                          2
                                   ???? ???.




12? 11? 8? ???
Horizontal layout
                                2
                        1
                                    3



                    3

                            3
                                        horizontalWrap ???
                                            ?? ???.



12? 11? 8? ???
Horizontal layout
                         2
                     1

                                    3




                             if horizontalWrap is false




12? 11? 8? ???
1. A row is horizontal
                 2. leftView is Vertical

                 ???



                 3. rightView is Vertical



12? 11? 8? ???
Variable Size Content




12? 11? 8? ???
Variable Size Content

                   Ti.UI.FILL
                   Ti.UI.SIZE   Ti.UI.SIZE




12? 11? 8? ???
Variable Size Content
                   Ti.UI.SIZE


                    Ti.UI.SIZE

                                  Ti.UI.SIZE? ??? ????
                        2         ??? ?? ?? ??? ???
                       Width
                     Ti.UI.SIZE   Ti.UI.SIZE? ??????.




12? 11? 8? ???
Variable Size Content


                                Ti.UI.FILL? ????,
                                ??? ?? ?? ???.
                       2
                     Width
                   Ti.UI.FILL




12? 11? 8? ???
4. Parallel Scrolling

                         ?? ???
                           ????



                 ?? ???
                 http://inze.it
                 http://www.yebocreative.com



12? 11? 8? ???
4. Parallel Scrolling

                         ?? ???
                           ????



                 ?? ???
                 http://inze.it
                 http://www.yebocreative.com



12? 11? 8? ???
??? ???.....?

                     320 x 320   ?? ??? ?? ?? ????
                    imageView          ??...




12? 11? 8? ???
??? ???.....?

                     320 x 320   ?? ? ?? ??? ??
                    imageView    ?? ???? ??...


                     tableView




12? 11? 8? ???
80 px


                 320 x 320
                             160 px
                 imageView




                                      80 px
                 tableView
                             ??? ?? ??? ??,
                             ??? ??? ???..



12? 11? 8? ???
80 px


                    320 x 320
                 clickableView    160 px
                   imageView




                                           80 px
                  tableView
                                 ?? ? ?? ?? ???
                                 ????..... ??? OTL



12? 11? 8? ???
?? ?????...
                  ?? ???...




12? 11? 8? ???
??? ?? ????!
                                  320 x 320
                               clickableView
                                 imageView     ?rst Row

                 window tableView




12? 11? 8? ???
???? ???? ??? ?????!

                 tableView.addEventListener("scroll", function(e) {

                 	 if (e.contentOffset.y <= 0) {   // ???? ??? ???

                 	 	 imageView.   animate({
                 	 	 	 top : 80 + (e.contentOffset.y / 2),
                 	 	 	 duration : 10
                 	 	 });
                 	 }
                 });




12? 11? 8? ???
5. Image Caching


                              ???? ??
                             ???? ????!




12? 11? 8? ???
??? ??,..



                              base64Encode
                  SQLite

                        base64decode




12? 11? 8? ???
??? ??,..
                    ???
??~~~~?
????


                 ??~~
                  SQLite

                                   base64decode
                                                base64Encode




12? 11? 8? ???
Solution!!

                            FileSystem.File.write(image)




                                            Store
                                           File Path

                   SQLite




12? 11? 8? ???
iPhone Special Directories
             /Documents/ - iTunes? ???? ??
             Titanium.Filesystem.applicationDataDirectory

             /Applications/ - ?????? ??
             Titanium.Filesystem.applicationDirectory

             /Library/Caches/ - ???? ???? ???? ??
             Titanium.Filesystem.applicationCacheDirectory

             /Library/Application Support/ - iCloud? ?? ???? ?? 
             ?? ?? ???? ??? ???? ???? ??
             Titanium.Filesystem.applicationSupportDirectory);

             /[AppName.app]/ - ? ??? ??	
             Titanium.Filesystem.resourcesDirectory);
             	
             /tmp/ - ????, ?? ??? ????? ????.           -- ???? ?? ????!
             Titanium.Filesystem.tempDirectory);
             	


12? 11? 8? ???
Tips) Share Documents with iTunes



                   info.plist ??? ??? ????.
                    UIFileSharingEnabled




12? 11? 8? ???
6. DB backup  update

                    ?? ?? ?? ??????
                      ?? ???? ??




12? 11? 8? ???
Synopsis
                 1. ???? ??? ???? ?? ?? ???.
                 2. ????? ????? ???.
                 3. ?? ?? ???? ???.
                 4. ?? ?? ???? ???


                 ??) DB ?? ????? ???!




12? 11? 8? ???
??? DB? ??


                               Ti.Network.createHTTPClient()



                                File Download  Replace




                 SQL Query Execute? NO.      it is slow!
                     Just Replace DB ?le?   YES

12? 11? 8? ???
T obstacles
                  wo

                 1. DB ??? ???? ??


                 2. Ti.Database.install() ???? ??




12? 11? 8? ???
DB File? ???? ??


                         Ti.Database.install(      )

                         /Library/Private Documents/



                  ???,
                  Private Documents ? ?????? ???? ??!!




12? 11? 8? ???
DB File? ???? ??


                                Ti.Database.install(                   )

                                /Library/Private Documents/

          var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory);
          var dbPath = file.nativePath.replace(

                 Documents/, Library/Private   %20Documents/
          );




12? 11? 8? ???
Ti.Database.install() ???? ??

            1. ????? /Library/Private Documents/ ??? .sql ???? DB ????.
            2. ?? ??? DB? ??? ?? ???? ???.


            ??? DB? ???? ???, ?? DB? ?????!




             var dbfile = Ti.Filesystem.getFile(dbPath, DATABASE_NAME + .sql);

             if (dbfile.exists()) {
             	 dbfile.deleteFile();
             }
             Ti.Database.install(newDBFile, DATABASE_NAME);




12? 11? 8? ???
Tips) phpLiteAdmin



                     http://code.google.com/p/phpliteadmin



                 DB? ???? ???, SQL?? ???? ??? ?? ??? ????!
                 $) chmod 777 ./sqlite




12? 11? 8? ???
7. Drawing Chart


                 ??? ????
                  ??? ???




12? 11? 8? ???
???? ?? ???? ????.




12? 11? 8? ???
??? ?? ???
                 ???? ???? ??? ^0^


                  ?? ???? ????..!




12? 11? 8? ???
?! ???,..
                 ??? ??? ???? ????




12? 11? 8? ???
??,.. ????..
                 ???? ?????...




12? 11? 8? ???
?.. ???,..
                 Ti SDK? ???? ??? API? ???
                         ???????




12? 11? 8? ???
??.. ?? ??!




12? 11? 8? ???
WebView Trick


                                    imageView
                          webView
                 window




                                         ?? ??? masking image?
                                                ??? ???.

12? 11? 8? ???
WebView Trick
                  webView    masking image




12? 11? 8? ???

More Related Content

????? ??? ???(???? ????)

  • 1. ???? ??? ?? ?? ????? ??? ??? 12? 11? 8? ???
  • 3. 9 month ago 12? 11? 8? ???
  • 4. ??? Dong9.org 12? 11? 8? ???
  • 6. 1. Modal Layer ??? ??? ???? ?????! 12? 11? 8? ???
  • 7. ????? ????... ???? ???? ?? ????. 12? 11? 8? ???
  • 8. ??? ?,.... ?? ??? ???? ??? ??? ??. 12? 11? 8? ???
  • 9. ??? ??, ??? ?? ?? ???, ? ?? ???? ?? ?? ???. var view = Ti.UI.createView({ opacity: 0.5 }); var layerView = Ti.UI.createView(); view.add(layerView); view.show(); 12? 11? 8? ???
  • 10. ??? ??? ??! ?? ?? opacity? ?? ??? ??? ??~~~ ???. 12? 11? 8? ???
  • 11. ??? ??, ??? ?? ?? ???, ? ?? ?? ??? ???? ?? ???. var view = Ti.UI.createView({ opacity: 0.5 }); win.add(view); var layerView = Ti.UI.createView(); win.add(layerView); view.show(); layerView.show(); 12? 11? 8? ???
  • 12. ??? ??? ??! ??? ?????, ?? ???? ?? ???? UI? ??? ? ??~~~ ??. 12? 11? 8? ???
  • 13. Solution! function Layer() { var dimmed = Ti.UI.createWindow({opacity:0.5, zIndex:1}); var content = Ti.UI.createWindow({zIndex:2}); this.open = function(){ dimmed.open(); content.open(); }; ... ?? ?? ???? ??? ???, ... return this; ??? ??? ???! }; module.exports = Layer 12? 11? 8? ???
  • 14. 2. Designed TabGroup ?? ??? ? ?? ??? 12? 11? 8? ???
  • 15. ???? ?? ??? ?? ??? ??? 12? 11? 8? ???
  • 16. memories of the layer ??, ?? ??? ???. 12? 11? 8? ???
  • 17. memories of the layer ??, ?? ??? ???. var tabGroup = Ti.UI.createTabGroup(); var win1 = Ti.UI.createWindow({ tabBarHidden : true }); var tab = Ti.UI.createTab({window: win1}); tabGroup.addTab(tab); 12? 11? 8? ???
  • 18. memories of the layer ??? ???? ???. 64x48 ??? ?? 5?? ??? ??? ?? ?? ??? ?? ?????. 20 px 48 px 64 px 12? 11? 8? ???
  • 19. memories of the layer ??? ????, ???? ???? ????. button.addEventListener("click", function(e) { // ?? ?? ?? oTabGroup.setActiveTab(e.source.index); }) 20 px 48 px 64 px 12? 11? 8? ???
  • 20. memories of the layer ???? ????, currentT .open(); Ti.UI. ab ??? ??? ????! 12? 11? 8? ???
  • 21. 3. Layout ??? ???? ???? 12? 11? 8? ???
  • 22. Three layout properties composite (Default) vertical horizontal 12? 11? 8? ???
  • 23. Composite layout ?? ?? ???? ??? ???? ???? ???. ?, ???? ??? ???? 12? 11? 8? ???
  • 24. Vertical layout 1 ??? ??? ??? ???? ???? ???, ??? ???? ?? ?? ?? ??? ???? 2 ???? ???. 12? 11? 8? ???
  • 25. Horizontal layout 2 1 3 3 3 horizontalWrap ??? ?? ???. 12? 11? 8? ???
  • 26. Horizontal layout 2 1 3 if horizontalWrap is false 12? 11? 8? ???
  • 27. 1. A row is horizontal 2. leftView is Vertical ??? 3. rightView is Vertical 12? 11? 8? ???
  • 29. Variable Size Content Ti.UI.FILL Ti.UI.SIZE Ti.UI.SIZE 12? 11? 8? ???
  • 30. Variable Size Content Ti.UI.SIZE Ti.UI.SIZE Ti.UI.SIZE? ??? ???? 2 ??? ?? ?? ??? ??? Width Ti.UI.SIZE Ti.UI.SIZE? ??????. 12? 11? 8? ???
  • 31. Variable Size Content Ti.UI.FILL? ????, ??? ?? ?? ???. 2 Width Ti.UI.FILL 12? 11? 8? ???
  • 32. 4. Parallel Scrolling ?? ??? ???? ?? ??? http://inze.it http://www.yebocreative.com 12? 11? 8? ???
  • 33. 4. Parallel Scrolling ?? ??? ???? ?? ??? http://inze.it http://www.yebocreative.com 12? 11? 8? ???
  • 34. ??? ???.....? 320 x 320 ?? ??? ?? ?? ???? imageView ??... 12? 11? 8? ???
  • 35. ??? ???.....? 320 x 320 ?? ? ?? ??? ?? imageView ?? ???? ??... tableView 12? 11? 8? ???
  • 36. 80 px 320 x 320 160 px imageView 80 px tableView ??? ?? ??? ??, ??? ??? ???.. 12? 11? 8? ???
  • 37. 80 px 320 x 320 clickableView 160 px imageView 80 px tableView ?? ? ?? ?? ??? ????..... ??? OTL 12? 11? 8? ???
  • 38. ?? ?????... ?? ???... 12? 11? 8? ???
  • 39. ??? ?? ????! 320 x 320 clickableView imageView ?rst Row window tableView 12? 11? 8? ???
  • 40. ???? ???? ??? ?????! tableView.addEventListener("scroll", function(e) { if (e.contentOffset.y <= 0) { // ???? ??? ??? imageView. animate({ top : 80 + (e.contentOffset.y / 2), duration : 10 }); } }); 12? 11? 8? ???
  • 41. 5. Image Caching ???? ?? ???? ????! 12? 11? 8? ???
  • 42. ??? ??,.. base64Encode SQLite base64decode 12? 11? 8? ???
  • 43. ??? ??,.. ???
  • 45. ???? ??~~ SQLite base64decode base64Encode 12? 11? 8? ???
  • 46. Solution!! FileSystem.File.write(image) Store File Path SQLite 12? 11? 8? ???
  • 47. iPhone Special Directories /Documents/ - iTunes? ???? ?? Titanium.Filesystem.applicationDataDirectory /Applications/ - ?????? ?? Titanium.Filesystem.applicationDirectory /Library/Caches/ - ???? ???? ???? ?? Titanium.Filesystem.applicationCacheDirectory /Library/Application Support/ - iCloud? ?? ???? ?? ?? ?? ???? ??? ???? ???? ?? Titanium.Filesystem.applicationSupportDirectory); /[AppName.app]/ - ? ??? ?? Titanium.Filesystem.resourcesDirectory); /tmp/ - ????, ?? ??? ????? ????. -- ???? ?? ????! Titanium.Filesystem.tempDirectory); 12? 11? 8? ???
  • 48. Tips) Share Documents with iTunes info.plist ??? ??? ????. UIFileSharingEnabled 12? 11? 8? ???
  • 49. 6. DB backup update ?? ?? ?? ?????? ?? ???? ?? 12? 11? 8? ???
  • 50. Synopsis 1. ???? ??? ???? ?? ?? ???. 2. ????? ????? ???. 3. ?? ?? ???? ???. 4. ?? ?? ???? ??? ??) DB ?? ????? ???! 12? 11? 8? ???
  • 51. ??? DB? ?? Ti.Network.createHTTPClient() File Download Replace SQL Query Execute? NO. it is slow! Just Replace DB ?le? YES 12? 11? 8? ???
  • 52. T obstacles wo 1. DB ??? ???? ?? 2. Ti.Database.install() ???? ?? 12? 11? 8? ???
  • 53. DB File? ???? ?? Ti.Database.install( ) /Library/Private Documents/ ???, Private Documents ? ?????? ???? ??!! 12? 11? 8? ???
  • 54. DB File? ???? ?? Ti.Database.install( ) /Library/Private Documents/ var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory); var dbPath = file.nativePath.replace( Documents/, Library/Private %20Documents/ ); 12? 11? 8? ???
  • 55. Ti.Database.install() ???? ?? 1. ????? /Library/Private Documents/ ??? .sql ???? DB ????. 2. ?? ??? DB? ??? ?? ???? ???. ??? DB? ???? ???, ?? DB? ?????! var dbfile = Ti.Filesystem.getFile(dbPath, DATABASE_NAME + .sql); if (dbfile.exists()) { dbfile.deleteFile(); } Ti.Database.install(newDBFile, DATABASE_NAME); 12? 11? 8? ???
  • 56. Tips) phpLiteAdmin http://code.google.com/p/phpliteadmin DB? ???? ???, SQL?? ???? ??? ?? ??? ????! $) chmod 777 ./sqlite 12? 11? 8? ???
  • 57. 7. Drawing Chart ??? ???? ??? ??? 12? 11? 8? ???
  • 58. ???? ?? ???? ????. 12? 11? 8? ???
  • 59. ??? ?? ??? ???? ???? ??? ^0^ ?? ???? ????..! 12? 11? 8? ???
  • 60. ?! ???,.. ??? ??? ???? ???? 12? 11? 8? ???
  • 61. ??,.. ????.. ???? ?????... 12? 11? 8? ???
  • 62. ?.. ???,.. Ti SDK? ???? ??? API? ??? ??????? 12? 11? 8? ???
  • 63. ??.. ?? ??! 12? 11? 8? ???
  • 64. WebView Trick imageView webView window ?? ??? masking image? ??? ???. 12? 11? 8? ???
  • 65. WebView Trick webView masking image 12? 11? 8? ???
  • 66. WebView Trick webView masking image 12? 11? 8? ???
  • 67. ????? ??? ??? ? miconblog@gmail.com dong9.org 12? 11? 8? ???