jpardogo / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
2.19k stars 354 forks source link

Wrong colors from 1.0.8 to 1.0.9 #72

Closed rafaeltoledo closed 9 years ago

rafaeltoledo commented 9 years ago

After upgrading to 1.0.9, I'm experiencing some different behavior with the colors. Running on Lollipop

1.0.8 v1.0.8

1.0.9 v1.0.9

jpardogo commented 9 years ago

Could you post you xml layout? If you are changing or defining anything dynamically, could you post it as well? Does the sample display for you the correct textPrimaryColor by default?

rafaeltoledo commented 9 years ago

That's my layout element

<com.astuetz.PagerSlidingTabStrip
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:textColor="@android:color/white"
    app:pstsIndicatorColor="@android:color/white" />

and my theme

    <style name="ParaPesquisa.Theme.Gray" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Different shades of gray -->
        <item name="colorPrimary">@color/action_bar</item>
        <item name="colorPrimaryDark">@color/color_5</item>
        <item name="colorAccent">@color/color_3</item>
    </style>
yolapop commented 9 years ago

My guess is Theme.AppCompat.Light has dark primary text color, given than you didn't set pstsTextColorSelected attribute, this library will use that primary color. android:textColor just sets inactive tabs' color. So quick fix is you should set pstsTextColorSelected.

jpardogo commented 9 years ago

Ok, that make sense.

Basically, this is what is happening:

What is happening to you is...

If I were you I would define item name="android:textColorPrimary in my theme to white and remove android:textColor="@android:color/white" app:pstsIndicatorColor="@android:color/white" in your layout.