CHAPTER 15: Developing for Android Wearable Devices 577
Figure 15-31. Copy and paste the marsIcon ImageView underneath itself and create a neptuneIcon ImageView
As you can see in Figure 5-31, the android:layout_margin parameters are in place for both
gravity="right" (or top|right, if you want) to push the planet icon into the right corner. Since top
is still the default, all you really need to accomplish this is the right constant! If you decide to use
“top|right” as your constant pair, which is also allowed, make sure not to have any spaces in this
constant, as the XML error system will think you are using a string and not a constant.
The final XML markup for the second
create the bottom planet icons. The XML markup, which is shown in Figure 15-31, looks like the
following:
<ImageView android:id="@+id/neptuneIcon" android:contentDescription="@string/neptuneClock"
android:layout_margin="6dip" android:layout_gravity="right"
android:src="@drawable/neptunebutton"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
As you can see in the Graphical Layout Editor tab in Figure 15-32, the top two planet icons are now
in place in the corners and are aligned perfectly thanks to the positioning fine-tuning provided by the
6 DP layout_margin.