Skip to content

ebernie/MyTabHostThemeSample

Repository files navigation

MyTabHostThemeSample

Example project on how to style a TabHost. Workflow:

  1. Generate XMLs and resources from an ActionBar style generator
  2. Copy all drawables into the project res folder. DO NOT use the generated styles.xml
  3. Refer to the offical guide on how to customize the actionbar background

res/values/styles_mytabhost.xml

<style name="MyTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    <!-- styles tab host indicator -->
    <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Mytabhost</item>
    <item name="actionBarTabStyle">@style/ActionBarTabStyle.Mytabhost</item>

    <!--styles actionbar -->
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="actionBarStyle">@style/MyActionBar</item>
</style>

<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
    <!-- action bar background -->
    <item name="background">@drawable/ab_solid_mytabhost</item>

    <!-- needed for 'stacked' & 'split' action bar (used by tabhost) -->
    <item name="backgroundStacked">@drawable/ab_stacked_solid_mytabhost</item>
    <item name="backgroundSplit">@drawable/ab_bottom_solid_mytabhost</item>
</style>

<style name="ActionBarTabStyle.Mytabhost" parent="@style/Widget.AppCompat.ActionBar.TabView">
    <item name="background">@drawable/tab_indicator_ab_mytabhost</item>
    <item name="android:background">@drawable/tab_indicator_ab_mytabhost</item>
</style>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages