Time for action - building the Photos tab

Before we can add images to a Gallery, we need the Gallery object on the screen. To start this exercise, we'll add a Gallery object and an ImageView to FrameLayout of our tabs. This will appear under the Photos tab that we created at the beginning of the chapter. We'll stick to a fairly traditional photo gallery model of the sliding thumbnails at the top of the screen, with the full view of the selected image below it.

  1. Open res/layout/main.xml in your editor or IDE.
  2. Inside the second LinearLayout, with android:id="@+id/photos", add a new Gallery element to hold the thumbnails:
    <Gallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
    
  3. Gallery objects, by ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.