Ramprasad
Ramprasad

Reputation: 8071

How to customize the Theme for whole Application

I used Theme.Sherlock.Light.DarkActionBar for my whole Application. Now the Action bar background color is black by default. How to change this color. Basically how to customize the Theme for whole Application?

<activity
            android:name="com.mypath.myapp.FirstActivity"
            android:label="@string/app_name"
            android:theme="@style/Theme.Sherlock.Light.DarkActionBar"
            >

Upvotes: 1

Views: 1798

Answers (4)

sanjeev mk
sanjeev mk

Reputation: 4336

You can use android:theme=theme_style in your <application> tag. Now if you want your action bar to be different than that given by the theme, then you can override it by defining the style between <style></style for your action bar specifically.

Here's the concept. Go to res > values > styles.xml. You can extend or customize your themes as follows:

     <style name="AppBaseTheme" parent="android:Theme.Light">
          <item name="android:background">@color/background_dark</item>
      </style>

Update: OR if you want to make generic (not theme specific) changes for all your applications, then you can edit sdk/platforms/android-target/data/res/values/styles.xml

OR if you want to override default themes for all your applications, then you can edit sdk/platforms/android-target/data/res/values/themes.xml

Update - found this:

ActionBar developer docs. This link says "You can control the behaviors and visibility of the action bar with the ActionBar APIs, which were added in Android 3.0 (API level 11)." So I assume your target is API 11 at minimum.

If you are targeting API 11 and above, you can do advanced custom styling as follows:

    <resources>
            <style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
                <item name="android:actionBarStyle">@style/MyActionBar</item>
            </style>

            <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
                <item name="android:background">@drawable/ab_background</item>
                <item name="android:backgroundStacked">@drawable/ab_background</item>
              <item name="android:backgroundSplit">@drawable/ab_split_background</item>
            </style>
    </resources>

Here you go , Styling Action Bar background

Upvotes: 1

Arash GM
Arash GM

Reputation: 10395

for modifying default android sdk themes You can find android Sdk themes.xml file in :

\android-sdk\platforms\...\data\res\values\themes.Xml

so you can change your whole application theme.

Upvotes: 0

Greeny
Greeny

Reputation: 1951

Have a look at http://actionbarsherlock.com/theming.html . You must create a own Theme-style.

Upvotes: 0

GrIsHu
GrIsHu

Reputation: 23638

You can define the theme for your whole application in your manifest file in application tag as below:

 <application
    android:name="com.test"
    android:icon="@drawable/appicon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar" > <---Define your own style here.

Upvotes: 0

Related Questions