to top
Android APIs
 

styles.xml

← Back

The file containing the source code shown below is located in the corresponding directory in <sdk>/samples/android-<version>/...

<!--
  Copyright 2011 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<resources>

    <style name="AppTheme" parent="android:style/Theme.Light">
        <item name="android:windowTitleSize">@dimen/actionbar_compat_height</item>
        <item name="android:windowTitleBackgroundStyle">@style/ActionBarCompat</item>
        <item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>

        <!-- for programmatic instantiation -->
        <item name="actionbarCompatTitleStyle">@style/ActionBarCompatTitle</item>
        <item name="actionbarCompatItemStyle">@style/ActionBarCompatItem</item>
        <item name="actionbarCompatItemHomeStyle">@style/ActionBarCompatHomeItem</item>
        <item name="actionbarCompatProgressIndicatorStyle">@style/ActionBarCompatProgressIndicator</item>
    </style>

    <style name="ActionBarCompat">
        <item name="android:background">#eee</item>
    </style>

    <style name="ActionBarCompatItemBase">
        <!-- layout_width/height must be set in code -->
        <item name="android:scaleType">center</item>
        <item name="android:background">@drawable/actionbar_compat_item</item>
    </style>

    <style name="ActionBarCompatProgressIndicator" parent="android:style/Widget.ProgressBar.Large">
        <item name="android:indeterminate">true</item>
    </style>

    <style name="ActionBarCompatTitleBase">
        <item name="android:id">@id/actionbar_compat_title</item>
        <!-- layout_width/height/weight must be set in code -->
        <item name="android:gravity">center_vertical</item>
        <item name="android:textSize">18sp</item>
        <item name="android:paddingLeft">6dp</item>
        <item name="android:paddingRight">6dp</item>
        <item name="android:singleLine">true</item>
        <item name="android:ellipsize">marquee</item>
    </style>

    <style name="ActionBarCompatTitle" parent="style/ActionBarCompatTitleBase">
        <item name="android:textColor">@color/actionbar_title_color</item>
    </style>

    <style name="ActionBarCompatItem" parent="style/ActionBarCompatItemBase">
    </style>

    <style name="ActionBarCompatHomeItem" parent="style/ActionBarCompatItemBase">
    </style>

</resources>