diff --git a/docs/html/resources/tutorials/views/hello-tabwidget.jd b/docs/html/resources/tutorials/views/hello-tabwidget.jd index abeb4bfff2d9a..9bafd84e26c15 100644 --- a/docs/html/resources/tutorials/views/hello-tabwidget.jd +++ b/docs/html/resources/tutorials/views/hello-tabwidget.jd @@ -39,19 +39,25 @@ public class ArtistsActivity extends Activity { android.widget.TextView}, give it some text and set that as the content. Duplicate this for each of the three activities, and add the corresponding <activity/> tags to the Android Manifest file.

-
  • You're going to need an icon for each of your tabs. And for each one, you should create an -image for two different states: one for when the tab is selected, and one for when it is not. The -general design recommendation is for the selected tab icon to be a darker color (grey), and the -non-selected icon to be lighter (white). For example: +
  • You need an icon for each of your tabs. For each icon, you should create two versions: one +for when the tab is selected and one for when it is unselected. The +general design recommendation is for the selected icon to be a dark color (grey), and the +unselected icon to be a light color (white). (See the Icon Design +Guidelines.) For example:

    - - + +

    -

    Copy these images for use in this tutorial. Save them into your project -res/drawable/ directory. You now need to create a {@link -android.graphics.drawable.Drawable} with XML that specifies which image -to use for each state. Create a new file in res/drawable/ named -ic_tab_artists.xml and insert the following:

    +

    For this tutorial, you can copy these images and use them for all three tabs. (When you +create tabs in your own application, you should create customized tab icons.)

    +

    Now create a state-list drawable +that specifies which image to use for each tab state:

    +
      +
    1. Save the icon images in your project res/drawable/ directory.
    2. +
    3. Create a new XML file in res/drawable/ +named ic_tab_artists.xml and insert the following:
       <?xml version="1.0" encoding="utf-8"?>
       <selector xmlns:android="http://schemas.android.com/apk/res/android">
      @@ -62,9 +68,13 @@ to use for each state. Create a new file in res/drawable/ named
           <item android:drawable="@drawable/ic_tab_artists_white" />
       </selector>
       
      -

      This is an XML definition for a {@link android.graphics.drawable.Drawable}, which you will -reference as the image for a tab. When the image state changes, the image will automatically -switch between the images defined here.

      +

      This is a state-list drawable, +which you will apply as the tab image. When the tab state changes, the tab icon will +automatically switch between the images defined here.

      +
    4. +
    +
  • Open the res/layout/main.xml file and insert the following:
    @@ -187,7 +197,7 @@ calling {@link android.widget.TabHost#addTab(TabHost.TabSpec)}.

    -

    Your application should look like this:

    +

    Your application should look like this (though your icons may be different):

    References