Android 40 Devices and DisplaysWord格式文档下载.docx
《Android 40 Devices and DisplaysWord格式文档下载.docx》由会员分享,可在线阅读,更多相关《Android 40 Devices and DisplaysWord格式文档下载.docx(22页珍藏版)》请在冰豆网上搜索。
Beflexible
Stretchandcompressyourlayoutstoaccommodatevariousheightsandwidths.
Optimizelayouts
Onlargerdevices,takeadvantageofextrascreenrealestate.Createcompoundviewsthatcombinemultipleviewstorevealmorecontentandeasenavigation.
Assetsforall
Provideresourcesfordifferentscreendensities(DPI)toensurethatyourapplooksgreatonanydevice.
Strategies
Sowheredoyoubeginwhendesigningformultiplescreens?
Oneapproachistoworkinthebasestandard(mediumsize,
MDPI)andscaleitupordownfortheotherbuckets.Anotherapproachistostartwiththedevicewiththelargestscreensize,andthenscaledownandfigureouttheUIcompromisesyou'
llneedtomakeonsmallerscreens.
Formoredetailedinformationonthistopic,pleasevisit
SupportingMultipleScreens.
Themes
GmailinHoloLight.
SettingsinHoloDark.
TalkinHoloLightwithdarkactionbar.
ThemesareAndroid'
smechanismforapplyingaconsistentstyletoanapporactivity.Thestylespecifiesthevisualpropertiesoftheelementsthatmakeupyouruserinterface,suchascolor,height,paddingandfontsize.Topromotegreatercohesionbetweenallappsontheplatform,AndroidprovidesthreesystemthemesthatyoucanchoosefromwhenbuildingappsforIceCreamSandwich:
∙HoloLight
∙HoloDark
∙HoloLightwithdarkactionbars
ApplyingthesethemeswillgoalongwayinhelpingyoutobuildappsthatfitrightintothegeneralvisuallanguageofAndroid.
Pickthesystemthemethatbestmatchestheneedsanddesignaestheticsforyourapp.Ifyourdesireistohaveamoredistinctlookforyourapp,usingoneofthesystemthemesasastartingpointforyourcustomizationsisagoodidea.Thesystemthemesprovideasolidfoundationontopofwhichyoucanselectivelyimplementyourownvisualstylings.
TouchFeedback
Usecolorandilluminationtorespondtotouches,reinforcetheresultingbehaviorsofgestures,andindicatewhatactionsareenabledanddisabled.
Wheneverausertouchesanactionableareainyourapp,provideavisualresponse.Thisletstheuserknowwhichobjectwastouchedandthatyourappis"
listening"
.
States
MostofAndroid'
sUIelementshavetouch-feedbackbuiltin,includingstatesthatindicatewhethertouchingtheelementwillhaveanyeffect.
Communication
Whenyourobjectsreacttomorecomplexgestures,helpusersunderstandwhattheoutcomeoftheoperationwillbe.Forexample,inRecents,whenyoustartswipingathumbnailleftorright,itstartstodim.Thishelpstheuserunderstandthatswipingwillcausetheitemtoberemoved.
Boundaries
Whenuserstrytoscrollpasttheupperorlowerlimitofascrollablearea,communicatetheboundarywithavisualcue.Forexample,ifauserattemptstoscrollpastthefirsthomescreenpanel,thescreencontenttiltstotherighttoindicatethatfurthernavigationinthisdirectionisnotpossible.ManyofAndroid'
sscrollableUIwidgets(e.g.listsorgridlists)alreadyhavesupportforboundaryfeedbackbuiltin.Ifyouarebuildingcustom,keepboundaryfeedbackinmindandprovideitfromwithinyourapp.
MetricsandGrids
Devicesvarynotonlyinphysicalsize,butalsoinscreendensity(DPI).Tosimplifythewayyoudesignformultiplescreens,thinkofeachdeviceasfallingintoaparticularsizebucketanddensitybucket.Thesizebucketsare
handset(smallerthan600dp)and
tablet
(largerthanorequal600dp).Thedensitybucketsare
LDPI,
MDPI,
HDPI,and
XHDPI.Optimizeyourapplication'
sUIbydesigningalternativelayoutsforsomeofthedifferentsizebuckets,andprovidealternativebitmapimagesfordifferentdensitybuckets.
Spaceconsiderations
Devicesvaryintheamountofdensity-independentpixels(dp)theycandisplay.
Toseemore,visitthe
ScreenSizesandDensitiesDeviceDashboard.
48dpRhythm
TouchableUIcomponentsaregenerallylaidoutalong48dpunits.
Why48dp?
Onaverage,48dptranslatetoaphysicalsizeofabout9mm(withsomevariability).Thisiscomfortablyintherangeofrecommendedtargetsizes(7-10mm)fortouchscreenobjectsanduserswillbeabletoreliablyandaccuratelytargetthemwiththeirfingers.
Ifyoudesignyourelementstobeatleast48dphighandwideyoucanguaranteethat:
∙yourtargetswillneverbesmallerthantheminimumrecommendedtargetsizeof7mmregardlessofwhatscreentheyaredisplayedon.
∙youstrikeagoodcompromisebetweenoverallinformationdensityontheonehand,andtargetabilityofUIelementso