Книга: Beginning Android
Galleries, Give or Take the Art
Galleries, Give or Take the Art
The Gallery
widget is not one ordinarily found in GUI toolkits. It is, in effect, a horizontally-laid-out listbox. One choice follows the next across the horizontal plane, with the currently-selected item highlighted. On an Android device, one rotates through the options through the left and right D-pad buttons.
Compared to the ListView
, the Gallery
takes up less screen space while still showing multiple choices at one time (assuming they are short enough). Compared to the Spinner
, the Gallery
always shows more than one choice at a time.
The quintessential example use for the Gallery
is image preview — given a collection of photos or icons, the Gallery
lets people preview the pictures in the process of choosing one.
Code-wise, the Gallery
works much like a Spinner
or GridView
. In your XML layout, you have a few properties at your disposal:
• android:spacing
controls the number of pixels between entries in the list.
• android:spinnerSelector
controls what is used to indicate a selection — this can either be a reference to a Drawable
(see the resources chapter) or an RGB value in #AARRGGBB
or similar notation.
• android:drawSelectorOnTop
indicates if the selection bar (or Drawable
) should be drawn before (false) or after (true) drawing the selected child — if you choose true
, be sure that your selector has sufficient transparency to show the child through the selector, otherwise users will not be able to read the selection.
- 4.4.4 The Dispatcher
- marta ketro
- About the author
- Chapter 7. The state machine
- Appendix E. Other resources and links
- Example NAT machine in theory
- 9.1.1. Partitions
- SCTP HEARTBEAT chunk
- SCTP HEARTBEAT ACK chunk
- The final stage of our NAT machine
- Compiling the user-land applications
- The conntrack entries