glaukon
Chapter 2: User Interface - Part 6
Okay then, tax is done. Let's move on. Add the following to the end of mainTable.

<TableRow

android:id="@+id/tableRow8"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textView6"

android:layout_width="wrap_content"

android:layout_height="1dp"

android:layout_marginBottom="3dp"

android:layout_marginLeft="25dp"

android:layout_marginRight="25dp"

android:layout_marginTop="3dp"

android:layout_span="3"

android:background="#000"

android:text="" />

</TableRow>


<TableRow

android:id="@+id/tableRow9"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textView7"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="right|center_vertical"

android:text="Grand Total:"

android:textAppearance="?android:attr/textAppearanceLarge" />


<TextView

android:id="@+id/textGTotal"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:gravity="center"

android:text="$0.00"

android:textAppearance="?android:attr/textAppearanceLarge" />

</TableRow>


<TableRow

android:id="@+id/tableRow10"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textView8"

android:layout_width="wrap_content"

android:layout_height="1dp"

android:layout_marginBottom="1dp"

android:layout_marginLeft="25dp"

android:layout_marginRight="25dp"

android:layout_marginTop="3dp"

android:layout_span="3"

android:background="#000"

android:text="" />

</TableRow>


<TableRow

android:id="@+id/tableRow11"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textView9"

android:layout_width="wrap_content"

android:layout_height="1dp"

android:layout_marginBottom="3dp"

android:layout_marginLeft="25dp"

android:layout_marginRight="25dp"

android:layout_marginTop="1dp"

android:layout_span="3"

android:background="#000"

android:text="" />

</TableRow>

There isn't much here that should surprise you. We made a line. Then we made a row with two Large TextViews. We set properties as necessary. Then we added two more lines, one after the other. However, this time, we made the bottom margin of the first one and the top margin of the second one both 1 dp, thus making the two lines much closer together, for aesthetic appeal.
We're done with the core of the app. Let's add an area where we will split the bill for our users. More code, below.

<TableRow

android:id="@+id/tableRow12"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textView10"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="right"

android:text="Split Bill:"

android:textAppearance="?android:attr/textAppearanceMedium" />

</TableRow>


<TableRow

android:id="@+id/tableRow13"

android:layout_width="wrap_content"

android:layout_height="wrap_content" >


<TextView

android:id="@+id/textSplit1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:gravity="right"

android:text="Customer" />


<TextView

android:id="@+id/textSplit1Dollar"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:gravity="center"

android:text="$0.00" />

</TableRow>

Look that over. There shouldn't be anything you don't get. If you're unsure about a property, look it up in the other Views we made using the Graphical Layout tab to figure out how the XML corresponds to Eclipse's GUI. If you're wondering why I used gravity instead of layout gravity for two of the TextViews... Don't worry about it. It has to do with a minute Java detail that I won't even go over. Trust me, it doesn't matter. If you really want to know, email me at glaukon@glaukon.com.