XAM205 - Navigation Patterns

rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

Thanks for joining in today. We had two questions where I had to investigate to answer them.

Number one was about Android'd TaskStackBuilder: what is it, what does it? I have never heard about it before but it is used when a notifications starts your application and directly goes to an Activity that is deep down in the navigation hierarchy. In this case you want to ensure that pressing the back button will navigate the screen hierarchy up. However as there is now hierarchy, you will have to provide it. For this the TaskStackBuilder can be used. More information can be found here.

Seconds one was: how to change the text color of the Android Action Bar Tabs? It turns out, that this tool is really good in creating a nice theme, however it does not allow to set the text color. The text color can be set manually. Details are copied from this blog post.

<resources>
    <style name="CustomActionBarTheme"
           parent="@style/Theme.Holo.Light">
        <item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item>
    </style>

    <style name="MyActionBarTabText"
           parent="@style/Widget.Holo.ActionBar.TabText">
        <item name="android:textColor">@color/actionbar_tabs</item>
    </style>
</resources>

<resources>
    <color name="actionbar_tabs">#CC043142</color>
</resources>
Sign In or Register to comment.