AndroidDesignPatternsandBestPractice
TableofContents
AndroidDesignPatternsandBestPractice
Credits
AbouttheAuthor
AbouttheReviewer
www.PacktPub.com
Whysubscribe?
CustomerFeedback
Preface
Whatthisbookcovers
Whatyouneedforthisbook
Whothisbookisfor
Conventions
Readerfeedback
Customersupport
Downloadingtheexamplecode
Downloadingthecolorimagesofthisbook
Errata
Piracy
Questions
1.DesignPatterns
Howthisbookworks
Whatwewillbuild
Thescenario
Theproblem
Thesolution
Targetingplatformversions
Thesupportlibrary
Thefactorypattern
UMLdiagrams
Runningandtestinganapp
Connectingtoarealdevice
Connectingtoavirtualdevice
Monitoringdevices
Theabstractfactorypattern
Workingwithmorethanonefactory
Summary
2.CreationalPatterns
Applyingthemes
Customizingcolorandtext
Usingpalettes
Customizingtext
Addingimageresources
Managingscreendensities
Usingdesignatedresources
Creatingacardview
Understandingcardviewproperties
ApplyingCardViewmetrics
Updatingthefactorypattern
Applyingabuilderpattern
Summary
3.MaterialPatterns
Theapp-bar
Imageassets
Applyingactions
Appbarstructure
Phones
Tablets
Thenavigationdrawer
Drawerconstruction
Ratiokeylines
Activatingthedrawer
Addingfragments
Righthandeddrawers
Thesingletonpattern
Summary
4.LayoutPatterns
Linearlayouts
Weightandgravity
Relativelayouts
Thepercentsupportlibrary
Screenrotation
Largescreenlayouts
Widthqualifiers
Layoutaliases
Thestrategypattern
Summary
5.StructuralPatterns
Generatinglists
Listitemlayouts
Materialfontsizes
Connectingdata
Translatingstringresources
Adaptersandlayoutmanagers
Theadapterpattern
Thebridgepattern
Thefacadepattern
Thecriteriapattern
Summary
6.ActivatingPatterns
Collapsingtoolbars
Applyingadatafactorypattern
Positioningitemlayouts
UsingthefactorywiththeRecyclerView
Addingdividers
Configuringthefloatingactionbutton
Thedialogbuilder
Customdialogs
Addingswipeanddismissactions
Constructinglayoutbuilders
Summary
7.CombiningPatterns
Outliningspecifications
Theprototypepattern
Settingupaprototype
Applyingtheprototype
Thedecoratordesignpattern
Settingupadecorator
Applyingthedecorator
Extendingthedecorator
Asandwichbuilderpattern
Applyingthepattern
ConnectingtoaUI
Selectingpatterns
Addingadecorator
Attachingthepattern
ConnectingthepatterntotheUI
Summary
8.ComposingPatterns
Thecompositepattern
Addingabuilder
ALayoutcomposer
Addingcomponents
Creatingcomposites
Createcompositelayouts
Formattinglayoutsatruntime
Storageoptions
Creatingstaticfiles
Creatingandeditingapplicationfiles
Storinguserpreferences