Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we remove background long press color of tab? #300

Open
PriyankaKamthe opened this issue Dec 30, 2016 · 2 comments
Open

Can we remove background long press color of tab? #300

PriyankaKamthe opened this issue Dec 30, 2016 · 2 comments

Comments

@PriyankaKamthe
Copy link

I am implementing PagerSlidingTabStrip and everything is working nicely.
But when i long pressed on tab, background color of tab gets blueish for a while. I just want to remove it.
Its looks like;
issue1

I also tried to set selector as tab background

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Active tab -->
    <item
        android:state_selected="true"
        android:state_focused="false"
        android:state_pressed="false"
        android:drawable="@color/Orange" />
    <!-- Inactive tab -->
    <item
        android:state_selected="false"
        android:state_focused="false"
        android:state_pressed="false"
        android:drawable="@color/gray" />
    <!-- Pressed tab -->
    <item
        android:state_pressed="true"
        android:drawable="@color/white" />

    <!-- Selected tab (using d-pad) -->
    <item
        android:state_focused="true"
        android:state_selected="true"
        android:state_pressed="false"
        android:drawable="@android:color/transparent" />
</selector>

But Still tab gets blueish when i long press on tab.

Following is my main_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.astuetz.PagerSlidingTabStrip
        android:id="@+id/tabbedDashboardTabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="@android:color/darker_gray"
        android:paddingBottom="10dp"
        android:paddingTop="10dp"
        android:textColor="#fff"
        android:textSize="18sp"
        app:pstsDividerColor="@android:color/white"
        app:pstsDividerPadding="0dp"
        app:pstsIndicatorColor="@android:color/holo_red_dark"
        app:pstsIndicatorHeight="80dp"
        app:pstsShouldExpand="true" />

    <android.support.v4.view.ViewPager
        android:id="@+id/dashboardTabPager"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@+id/tabbedDashboardTabs"
        android:scrollbarAlwaysDrawVerticalTrack="true" />

</RelativeLayout>

Please provide suitable solution.

@ka05
Copy link

ka05 commented Oct 31, 2017

@PriyankaKamthe Have you found a way to do this yet? I would also like to know. I also tried the selector drawable for setTabBackground() and no dice.

@PriyankaKamthe
Copy link
Author

@ka05 sorry for late reply. I don't find any solution for this but i find out hack to solve my problem.I kept PagerSlidingTabStrip height as constant value like 50dp or something instead of 'wrap_content'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants