Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)
17. Two-Pane Master-Detail Interfaces In this chapter, you will create a tablet interface for CriminalIntent that allows users t ...
Chapter 17 Two-Pane Master-Detail Interfaces You will need a tablet device or AVD for testing in this chapter. To create a tabl ...
Adding Layout Flexibility Adding Layout Flexibility On a phone, you want CrimeListActivity to inflate a single-pane layout, as i ...
Chapter 17 Two-Pane Master-Detail Interfaces Modifying SingleFragmentActivity CrimeListActivity is a subclass of SingleFragment ...
Creating a layout with two fragment containers Creating a layout with two fragment containers In the project tool window, right- ...
Chapter 17 Two-Pane Master-Detail Interfaces Run CriminalIntent on a tablet device and confirm that you have two panes (Figure ...
Using an alias resource Using an alias resource An alias resource is a resource that points to another resource. Alias resources ...
Chapter 17 Two-Pane Master-Detail Interfaces Creating tablet alternatives Because your alias is in res/values/, it is the defau ...
Activity: Fragment Boss Android does not provide a way to use a resource only when a device is under a particular size, but it d ...
Chapter 17 Two-Pane Master-Detail Interfaces Fragment callback interfaces To delegate functionality back to the hosting activit ...
Fragment callback interfaces In CrimeListFragment.java, add a Callbacks interface to CrimeListFragment. Also add an mCallbacks v ...
Chapter 17 Two-Pane Master-Detail Interfaces Next, in CrimeListActivity, implement CrimeListFragment.Callbacks. Leave onCrimeSe ...
Fragment callback interfaces In CrimeListActivity.java, implement onCrimeSelected(Crime) to handle the selection of a crime in e ...
Chapter 17 Two-Pane Master-Detail Interfaces Run CriminalIntent on a tablet. Create a new crime, and a CrimeFragment will be ad ...
Fragment callback interfaces Before you start with CrimeFragment’s interface, change the visibility of CrimeListFragment.updateU ...
Chapter 17 Two-Pane Master-Detail Interfaces Now implement CrimeFragment.Callbacks in CrimeListActivity to reload the list in o ...
Fragment callback interfaces Then add calls in CrimeFragment.java to updateCrime() when a Crime’s title or solved status has cha ...
Chapter 17 Two-Pane Master-Detail Interfaces You also need to call updateCrime() in onActivityResult(...), where the Crime’s da ...
For the More Curious: More on Determining Device Size For the More Curious: More on Determining Device Size Before Android 3.2, ...
...
«
13
14
15
16
17
18
19
20
21
22
»
Free download pdf