售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Creating Dynamic UIs with Android Fragments Second Edition
Table of Contents
Creating Dynamic UIs with Android Fragments Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Fragments and UI Modularization
The need for a new approach to UI creation
The broad platform support of fragments
How fragments simplify common Android tasks
The relationship between fragments and activities
Making the shift to fragments
The old thinking – activity-oriented
Defining the activity appearance
Displaying the activity UI
The new thinking: fragment-oriented
Creating the fragment layout resources
Defining the layout as a reusable list
Minimizing assumptions
Encapsulating the display layout
Creating the Fragment class
Wrapping the list in a fragment
Providing the description fragment
Converting an activity to use fragments
Summary
2. Fragments and UI Flexibility
Creating UI flexibility
Dynamic fragment layout selection
Adding an alternate layout resource
Managing fragment layout by screen size
Eliminating redundant layout descriptions
Layout aliasing
Designing fragments for flexibility
Avoiding tight coupling
Abstracting fragment relationships
Defining the callback interface
Making the fragment self-contained
Fragment notification
Encapsulating fragment operations
Creating a loosely connected relationship between fragments
Fragments protect against the unexpected
Creating the book description activity
Adding functionality to the book description activity
Making the MainActivity class adaptive
Summary
3. Fragment Life Cycle and Specialization
Understanding the fragment life cycle
Understanding fragment setup and display
Avoiding method name confusion
Understanding fragment hide and teardown
Maximizing the available resources
Managing a fragment state
Special-purpose fragment classes
ListFragment
Associating data with the list
Separating data from the display
Creating the ListFragment derived class with Android Studio
Handling the ListFragment item selection
Updating the layout resources
DialogFragment
Styles
Layout
Displaying DialogFragment
Event handling in DialogFragment
The Dialog identity
Accessing behavior related to Dialog
Wrapping an existing dialog in a fragment
Summary
4. Working with Fragment Transactions
Intentional screen management
Dynamically managing fragments
Deferred execution of transaction changes
Adding and removing fragments
Supporting the back button
Creating an adaptive application layout
Updating the layout to support dynamic fragments
Adapting to device differences
Dynamically loading a fragment at startup
Transitioning between fragments
Eliminating redundant handling
Creating the fragment on the fly
Managing asynchronous creation
Putting it all together
Summary
5. Creating Rich Navigation
A brave new world
Making navigation fun with swipe
Implementing swipe navigation
Adding swipe navigation with Android Studio
Managing the swipe UI behavior
Putting the swipe UI into place
Providing direct navigation to screens
Don't get trapped in the past
Direct navigation for a small number of screens
Direct navigation for four or more screens
Creating a navigation drawer activity with Android Studio
The activity and application screen fragment
The navigation drawer fragment
Navigation drawer fragment standard responsibilities
The additional responsibilities of the NavigationDrawerFragment class
The navigation drawer fragment responsibilities big picture
Summary
6. Fragments and Material Design
Creating a rich user experience
Material design
Principles of material design
The role of motion
Converting our application to use material design
Dealing with different Android versions
Setting up the theme
Updating the fragments appearance
Incorporating motion in fragment transitions
Transitioning fragments on and off the screen
Transitioning the book card off and on the screen
Transitioning the book details on and off the screen
Creating continuity with shared element transitions
Maintaining continuity across multiple cards
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜