Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d17619f6 authored by Scott Main's avatar Scott Main Committed by Android Git Automerger
Browse files

am cd4e1c46: am f151391b: fix markup errors in action bar styling, add more...

am cd4e1c46: am f151391b: fix markup errors in action bar styling, add more information about using drawables, move \'managing the activity lifecycle\' down a notch, because it\'s less interesting.

* commit 'cd4e1c46':
  fix markup errors in action bar styling, add more information about using drawables, move 'managing the activity lifecycle' down a notch, because it's less interesting.
parents 978ec174 cd4e1c46
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -74,7 +74,21 @@ is available in the action bar, but the
Settings action should always appear in the overflow. (By default, all actions appear in the
overflow, but it's good practice to explicitly declare your design intentions for each action.)

<p>However, <strong>if your app is using the Support Library</strong> for compatibility on versions
<p>The {@code icon} attribute requires a resource ID for an
image. The name that follows {@code &#64;drawable/} must be the name of a bitmap image you've
saved in your project's {@code res/drawable/} directory. For example,
{@code "&#64;drawable/ic_action_search"} refers to {@code ic_action_search.png}.
Likewise, the {@code title} attribute uses a string resource that's defined by an XML
file in your project's {@code res/values/} directory, as discussed in <a
href="{@docRoot}training/basics/firstapp/building-ui.html#Strings">Building a Simple User
Interface</a>.

<p class="note"><strong>Note:</strong> When creating icons and other bitmap images for your app,
it's important that you provide multiple versions that are each optimized for a different screen
density. This is discussed more in the lesson about <a
href="{@docRoot}training/basics/supporting-devices/screens.html">Supporting Different Screens</a>.

<p><strong>If your app is using the Support Library</strong> for compatibility on versions
as low as Android 2.1, the {@code showAsAction} attribute is not available from
the {@code android:} namespace. Instead this attribute is provided by the Support Library
and you must define your own XML namespace and use that namespace as the attribute prefix.
+18 −18
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ trainingnavtop=true
<ul>
  <li><a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a></li>
  <li><a class="external-link" target="_blank"
  href="http://jgilfelt.github.io/android-actionbarstylegenerator/">Android Action Bar Style
  href="http://www.actionbarstylegenerator.com">Android Action Bar Style
  Generator</a></li>
</ul>

@@ -146,13 +146,13 @@ background like this:</p>
    &lt;style name="CustomActionBarTheme"
           parent="&#64;style/Theme.Holo.Light.DarkActionBar">
        &lt;item name="android:actionBarStyle">&#64;style/MyActionBar&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar styles -->
    &lt;style name="MyActionBar"
           parent="&#64;style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        &lt;item name="android:background">&#64;drawable/actionbar_background&lt;/item>
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -178,7 +178,7 @@ background like this:</p>

        &lt;!-- Support library compatibility -->
        &lt;item name="actionBarStyle">&#64;style/MyActionBar&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar styles -->
    &lt;style name="MyActionBar"
@@ -187,7 +187,7 @@ background like this:</p>

        &lt;!-- Support library compatibility -->
        &lt;item name="background">&#64;drawable/actionbar_background&lt;/item>
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -236,25 +236,25 @@ for each text element:</p>
        &lt;item name="android:actionBarStyle">&#64;style/MyActionBar&lt;/item>
        &lt;item name="android:actionBarTabTextStyle">&#64;style/MyActionBarTabText&lt;/item>
        &lt;item name="android:actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar styles -->
    &lt;style name="MyActionBar"
           parent="&#64;style/Widget.Holo.ActionBar">
        &lt;item name="android:titleTextStyle">&#64;style/MyActionBarTitleText&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar title text -->
    &lt;style name="MyActionBarTitleText"
           parent="&#64;style/TextAppearance.Holo.Widget.ActionBar.Title">
        &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar tabs text styles -->
    &lt;style name="MyActionBarTabText"
           parent="&#64;style/Widget.Holo.ActionBar.TabText">
        &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -280,7 +280,7 @@ for each text element:</p>
        &lt;item name="actionBarStyle">&#64;style/MyActionBar&lt;/item>
        &lt;item name="actionBarTabTextStyle">&#64;style/MyActionBarTabText&lt;/item>
        &lt;item name="actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar styles -->
    &lt;style name="MyActionBar"
@@ -289,21 +289,21 @@ for each text element:</p>

        &lt;!-- Support library compatibility -->
        &lt;item name="titleTextStyle">&#64;style/MyActionBarTitleText&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar title text -->
    &lt;style name="MyActionBarTitleText"
           parent="&#64;style/TextAppearance.<strong>AppCompat</strong>.Widget.ActionBar.Title">
        &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
        &lt;!-- The textColor property is backward compatible with the Support Library -->
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar tabs text -->
    &lt;style name="MyActionBarTabText"
           parent="&#64;style/Widget.<strong>AppCompat</strong>.ActionBar.TabText">
        &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
        &lt;!-- The textColor property is backward compatible with the Support Library -->
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -392,14 +392,14 @@ for several different states of an action bar tab:</p>
    &lt;style name="CustomActionBarTheme"
           parent="&#64;style/Theme.Holo">
        &lt;item name="android:actionBarTabStyle">&#64;style/MyActionBarTabs&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar tabs styles -->
    &lt;style name="MyActionBarTabs"
           parent="&#64;style/Widget.Holo.ActionBar.TabView">
        &lt;!-- tab indicator -->
        &lt;item name="android:background">&#64;drawable/actionbar_tab_indicator&lt;/item>
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -420,7 +420,7 @@ for several different states of an action bar tab:</p>

        &lt;!-- Support library compatibility -->
        &lt;item name="actionBarTabStyle">&#64;style/MyActionBarTabs&lt;/item>
    &lt;style>
    &lt;/style>

    &lt;!-- ActionBar tabs styles -->
    &lt;style name="MyActionBarTabs"
@@ -430,7 +430,7 @@ for several different states of an action bar tab:</p>

        &lt;!-- Support library compatibility -->
        &lt;item name="background">&#64;drawable/actionbar_tab_indicator&lt;/item>
    &lt;style>
    &lt;/style>
&lt;/resources>
</pre>

@@ -442,7 +442,7 @@ for several different states of an action bar tab:</p>
  href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> guide.</li>
  <li>For even more complete styling for the action bar,
try the <a class="external-link" target="_blank"
  href="www://http.actionbarstylegenerator.com">Android Action Bar Style
  href="http://www.actionbarstylegenerator.com">Android Action Bar Style
  Generator</a>.</li>
</ul>
</div>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ public void onCreate(Bundle savedInstanceState) {
</pre>

<p class="caution"><strong>Caution:</strong> Using the {@link android.os.Build.VERSION#SDK_INT} to
prevent older system's from executing new APIs works in this way on Android 2.0 (API level
prevent older systems from executing new APIs works in this way on Android 2.0 (API level
5) and higher only. Older versions will encounter a runtime exception.</p>

<p>Once the {@link android.app.Activity#onCreate onCreate()} finishes execution, the system
+2 −2
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ next.link=platforms.html
    <ul>
      <li><a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple
Screens</a></li>
      <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
Screens</a></li>
      <li><a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing
        Resources</a></li>
      <li><a href="{@docRoot}design/style/iconography.html">Iconography design guide</a></li>
    </ul>
  </div>
+24 −24
Original line number Diff line number Diff line
@@ -68,27 +68,23 @@ include the action bar on devices running Android 2.1 or higher."

      <li class="nav-section">
        <div class="nav-section-header">
          <a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html"
          <a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html"
             description=
             "How Android activities live and die and how to create
             a seamless user experience by implementing lifecycle callback methods."
            >Managing the Activity Lifecycle</a>
             "How to build your app with alternative resources that provide an
             optimized user experience on multiple device form factors using a single APK."
            >Supporting Different Devices</a>
        </div>
        <ul>
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/starting.html">
            Starting an Activity
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/pausing.html">
            Pausing and Resuming an Activity
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
            Supporting Different Languages
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/stopping.html">
            Stopping and Restarting an Activity
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
            Supporting Different Screens
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/recreating.html">
            Recreating an Activity
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
            Supporting Different Platform Versions
          </a>
          </li>
        </ul>
@@ -96,23 +92,27 @@ include the action bar on devices running Android 2.1 or higher."

      <li class="nav-section">
        <div class="nav-section-header">
          <a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html"
          <a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html"
             description=
             "How to build your app with alternative resources that provide an
             optimized user experience on multiple device form factors using a single APK."
            >Supporting Different Devices</a>
             "How Android activities live and die and how to create
             a seamless user experience by implementing lifecycle callback methods."
            >Managing the Activity Lifecycle</a>
        </div>
        <ul>
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
            Supporting Different Languages
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/starting.html">
            Starting an Activity
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
            Supporting Different Screens
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/pausing.html">
            Pausing and Resuming an Activity
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
            Supporting Different Platform Versions
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/stopping.html">
            Stopping and Restarting an Activity
          </a>
          </li>
          <li><a href="<?cs var:toroot ?>training/basics/activity-lifecycle/recreating.html">
            Recreating an Activity
          </a>
          </li>
        </ul>