Time for action - creating a Burger item layout

The first thing to do in order to create a nice looking menu for The Burger Place is to design the menu items. This is done in much the same way as the styling of the restaurant list with a layout XML resource. However, since we will be building the ListAdapter ourselves this time, we are not forced to use a single TextView, but can instead build a more complex layout.

  1. Create a new XML file in the res/layout directory named burger_item.xml. This file will be used for each burger in the ListView.
  2. Declare the root of the layout as a horizontal LinearLayout (note the height, which will be the height of each item in the ListView):
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

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.