A (175)

(Tuis.) #1
CHAPTER 8: Android UI Design: Using Advanced ViewGroup Layout Containers 293

Figure 8-20. Add a at the end of the existing design and add an child tag inside it


Then copy and paste the required layout_width and layout_height parameters from the


tag into the parent tag, so that the parameter configuration
shown in Figure 8-19 is the following:

<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spLayout"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"
android:layout_width="match_parent" android:layout_height="match_parent" >


Go to the bottom of the new UI definition, and add a container structure, right above
the closing container closing tag, and add an tag inside it, as
is shown in Figure 8-20.


Since the UI widget needs a digital image to use for its “source” or android:src
parameter, let’s copy the three galaxy images, named galaxybutton1.png, galaxybutton2.png, and
galaxybutton3.png into the /res folder using the Windows Explorer file management utility next.


As you can see in Figure 8-21, I have copied these files, which are in the project files repository for
the book, into the /res/drawable-hdpi folder.

Free download pdf