GithubHelp home page GithubHelp logo

Comments (4)

ogaclejapan avatar ogaclejapan commented on September 21, 2024

Hi, @vibhorB

Oh,,, sorry.
The current version is to be able to specify the background for touch feedback.

Background do you change for each tab?
If the same background, please specify in the background of the TabLayout.

from smarttablayout.

apradanas avatar apradanas commented on September 21, 2024

Hi @ogaclejapan

I'm having the same issue. I set stl_defaultTabBackground to a selector for touch feedback app:stl_defaultTabBackground="@drawable/bg_selector", and the indicator still gets hidden.

Here's my bg_selector:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/blue" android:state_pressed="true"/>
    <item android:drawable="@color/red"/>
</selector>

Is there something missing?

In my case, specify the background of the TabLayout isn't something I need. CMIIW, it won't work for touch feedback anyway.

Thanks

from smarttablayout.

apradanas avatar apradanas commented on September 21, 2024

Hi again @ogaclejapan

So, I managed to fix my problem. I changed my bg_selector:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:state_selected="true">
        <layer-list>
            <item android:bottom="5dp" android:drawable="@color/blue"/>
        </layer-list>
    </item>
    <item android:state_selected="true">
        <layer-list>
            <item android:bottom="5dp" android:drawable="@color/red"/>
        </layer-list>
    </item>
    <item android:state_pressed="true">
        <layer-list>
            <item android:bottom="1dp" android:drawable="@color/blue"/>
        </layer-list>
    </item>
    <item>
        <layer-list>
            <item android:bottom="1dp" android:drawable="@color/red"/>
        </layer-list>
    </item>
</selector>

Well, that's not an ideal solution, but at least fix my problem for now. The idea is to put offset at the bottom in order to make the bottom indicator visible. I have app:stl_underlineThickness="1dp" and app:stl_indicatorThickness="5dp".

Anyway, I suspect the root cause is in SmartTabLayout#populateTabStrip, specifically tabStrip.addView(tabView);. If the tabView (which is TextView) background was set to specific color, it would drawn in front of the tabStrip, so the tabStrip's indicator would never visible. Maybe you should specify margin for the tabView.

Really hope you could fix this issue with the best solution.

Thanks

from smarttablayout.

ogaclejapan avatar ogaclejapan commented on September 21, 2024

Hi, @vibhorB @apradanas

Right now, 1.5.0 released : )

stl_drawDecorationAfterTab="true"

So, this issue it will close.

from smarttablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.