A (175)

(Tuis.) #1

574 CHAPTER 15: Developing for Android Wearable Devices


Next, right-click on the res/values/strings.xml file to Open it. Add four constants after
the first app_name constant named marsClock, earthClock, neptuneClock, and jupiterClock,
respectively. Then add descriptive text values for the sight impaired. The XML mark-up shown in
Figure 15-27 looks like this:


Use Mars Clock on Smartwatch
Use Mars Clock on Smartwatch
Use Mars Clock on Smartwatch
Use Mars Clock on Smartwatch

Figure 15-27. Add constants for the contentDescription parameter of the four planet tags


Now that you have your image assets and string constants in place, you can add icons to your
UI design.


Adding Four ImageView UI Icons to a UI Design


Since you are going to be positioning the planet icons using the android:layout_gravity parameter
with the top, right, and bottom constants to position the planet icons in the corners of the UI design,
you can simply add the child tags underneath the child tag. Add a
line of space underneath your tag, and type a left facing chevron < character to
bring up a supported child tag pop-up helper dialog, as shown in Figure 15-28. Double-click on the
ImageView UI widget, which will insert it in your mark-up.

Free download pdf