Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Mobile Design PatternsMobile Design Patterns
By Dan Hermes
dan@lexiconsystemsinc.com
www.lexiconsystemsinc.com
Boston Code Camp 21
Design PatternsDesign Patterns
Gang Of Four
MVC
MVVM
Adaptable, reusable code structures
Mobile Concepts and PatternsMobile Concepts and Patterns
UI
◦ Visual Design Patterns
Data Access
◦ Local
◦ Web Services
◦ Data Binding
◦ Data Synchronization
State Management
Threading
MVC vs. MVVM
Visual Design PatternsVisual Design Patterns
Data Presentation
Navigation
Search/Sort
Dialog
Data Editing
Data Presentation Patterns
List
Layout
Grid
Subview
Master/Detail
Gallery
Android List DemoAndroid List Demo
Array Adapter
Bind to a Model
iOS List ExampleiOS List Example
Instantiate UITableView and add it to a
view in the ViewDidLoad() method of the
ViewController.
public override void ViewDidLoad()
{
base.ViewDidLoad();
UITableView table = new UITableView(View.Bounds);
Add (table);
}
iOS List Example –iOS List Example –
SubclassSubclass UITableViewSourceUITableViewSource
public class ListSource : UITableViewSource
{
  protected string[] listItems;
protected string CellId= "TableCell";
  public ListSource (string[] items)
{ listItems = items; }
  public override int RowsInSection (UITableView tableview, int section)
{ return listItems.Length; }
public override UITableViewCell GetCell (UITableView tableView,
MonoTouch.Foundation.NSIndexPath indexPath)
{ UITableViewCell cell = tableView.DequeueReusableCell (CellId);
if (cell == null) cell = new UITableViewCell (UITableViewCellStyle.Default, CellId);
cell.TextLabel.Text = listItems[indexPath.Row];
return cell;
}
}
iOS List ExampleiOS List Example
public override void ViewDidLoad()
{
base.ViewDidLoad();
UITableView table = new UITableView(View.Bounds);
var tableItems = new string[]
{"First","Second","Third","Fourth","Fifth"};
table.Source = new ListSource(tableItems);
Add (table);
}
Navigation
Images courtesy of Mobile Design Pattern Gallery by Theresa Neil
More Navigation
Images courtesy of Mobile Design Pattern Gallery by Theresa Neil
Forms
Images courtesy of Mobile Design Pattern Gallery by Theresa Neil
Style and DesignStyle and Design
Why Does It Matter?
Style and DesignStyle and Design
Form follows function
◦ What is your apps message?
To the Point
Consistency
" If it looks the same, it should act the same." - Android Style Guide
Style and DesignStyle and Design
Direct Manipulation
Feedback
Personal Service
Encouragement
MobilismsMobilisms
Standard icons
Standard screen layouts
Standard multi-screen flows
Use labels sparingly
Standard multi-screen approaches
Avoid PCisms
Images courtesy of Mobile Design Pattern Gallery by Theresa Neil
Idiot Box
Oceans of Buttons
Anti-Pattern Advice:
AVOID CREATIVITY
until you know mobile UI standards
Mobile Interaction ChartMobile Interaction Chart
Mobile Action PC
Tap I want this click
Submit Do it submit
Swipe Next! Move, or Delete next
Press Do Something Double-click
Pinch Zoom out Roller/slider
Spread Zoom in Roller/slider
Rotate um, Rotate. Roller/slider
http://www.lexiconsystemsinc.com/
ViewsViews
Xamarin.Forms
Android Views
iOS UIKit
Xamarin.Forms List DemoXamarin.Forms List Demo
Android: ActivitiesAndroid: Activities
An Activity is like a…
Code-Behind
iOS: ViewControllersiOS: ViewControllers
A ViewController is like a…
Code-Behind
UI - iOSUI - iOS
ViewController
Xcode or Xamarin iOS Designer
You need a Mac
◦ Mac Mini
◦ macincloud.com
Xamarin iOS DesignerXamarin iOS Designer
MVCMVC
iOS ViewControllers
 Android Activities
Are they MVC?
Some CodeSome Code
MVCMVC
Model
◦ Can use them
Views
◦ Must use them
Controllers
◦ Android Activities
◦ iOS ViewControllers
I WANT MY MVC!!!I WANT MY MVC!!!
The OptionsThe Options
MVVM
◦ MVVMcross
◦ MVVM Lite
◦ ReactiveUI
Roll Your Own MVC
◦ Separate out your controller logic from your
Activities, ViewControllers, and Pages
Mobile Design PatternsMobile Design Patterns
Dan Hermes
Mobile Consultant
Lexicon Systems
Website: www.lexiconsystemsinc.com
Email: dan@lexiconsystemsinc.com
Phone: 781-526-0738
Twitter: @lexiconsystems
Blog: www.itshopkeeping.com

More Related Content

Mobile UI Design Patterns