Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Denver Droids: UI

Denver Droids: UI

My first ever Android presentation. Uploaded for posterity.

Dave Smith

April 20, 2011
Tweet

More Decks by Dave Smith

Other Decks in Programming

Transcript

  1. Use(a(Library.((Move(on.( •  DashboardLayout( –  Roman(Nurik(@(Google( –  Custom(Layout(for(Dashboard(Grids( –  gist.github.com/882650( • 

    GreenDroid( –  Requires(a(custom(Applica%on(class((Boo)( –  Ac%onBar( –  QuickAc%on( –  AsyncImageView( –  github.com/cyrilmoaer/GreenDroid( •  Ac%onBarSherlock( –  Drop/in(Widget( –  Honeycomb(Compa%ble(Ac%onBar( –  github.com/JakeWharton/Ac%onBarSherlock( •  CommonsWare(Android(Components((CWAC)( –  EndlessAdapter( –  ColorMixer( –  github.com/commonsguy(
  2. How(Android(Classifies(Screens( •  Size( –  Small((<3")( –  Normal((3"/5")( –  Large((5"/7")( – 

    xLarge((7"/10";(Android(2.3)( •  Density( –  Low((ldpi)( •  75%(MDPI( –  Medium((mdpi)( –  High((hdpi)( •  150%(MDPI( –  Xtra/High((xhdpi;(Android(2.2)( •  200%(MDPI( •  Eek!((That's(16(Different(Configura%ons(to(support!(…Not(really(
  3. Recipe(for(Phone(UI( •  Scale(Images(for(all(Densi%es( •  Build(Layouts(for(one(size( res/drawable( res/drawable/ldpi( res/drawable/mdpi( res/drawable/hdpi( res/layout(

    res/layout/land( •  Shut(out(tablets(by(adding(the(following(manifest(item:( <uses-feature !android:name="android.hardware.telephony"/>!
  4. Recipe(for(Adding(Tablet(Support( •  Double(your(MDPI(Assets(Resolu%ons( •  Add(layouts(for(larger(screens( res/layout/large( res/layout/large/land( res/layout/xlarge( res/layout/xlarge/land( • 

    "3.0(only"(support(can(use(the(v11(qualifier(instead( res/layout/v11( res/layout/v11/land( •  Shut(out(phones(by(adding(the(following(manifest(item:( <supports-screens! !!android:smallScreens="false"! !!android:normalScreens="false"/>!
  5. Smart(Kids(Use(XML( •  Use(XML(whenever(possible!( –  Android(itself(has(more(lines(of(XML(than(any(other( language((Java,(C,(or(C++)…learn(from(that.( –  XML(Resources(are(inherently(scalable( •  Shapes(

    •  Gradients( •  Selectors((Color,(Image)( •  Place(all(XML(drawables(into(res/drawable( –  Resolu%on(Independent( •  9/Patches(are(annoying,(try(to(avoid(them(
  6. Smart/Kid(Road:(Handle(It(Yourself( •  Tell(Android(to(no%fy(you(of(the(change,(and(you'll(take(care(of(the( upkeep( •  Add(android:configChanges="keyboardHidden|orientation"(to( the(<activity>(element( •  Implement(onConfigurationChanged()(in(the(Ac%vity(code.( • 

    Android(will(not(destroy(your(Ac%vity( •  If(you(do(not(have(separate(resources((layouts,(etc.)(for(landscape( vs.(portrait…you're(done!( •  If(you(DO(have(a(special("layout/land"(or(the(like,(a(quick(call(to( setContentView()(will(redraw(your(view(with(the(right(resources.( –  You(will(also(have(to(reaWach(any(pointers(grabbed(through( findViewById()! •  No(other(state(need(be(saved(or(restored.!