Comments (4)
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.
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.
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 . 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.
Hi, @vibhorB @apradanas
Right now, 1.5.0 released : )
stl_drawDecorationAfterTab="true"
So, this issue it will close.
from smarttablayout.
Related Issues (20)
- PagerAdapter for View-based Page
- java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
- Its not working with ViewPager2? HOT 7
- Selected Text Color
- custom integration
- How to change tab text color dynamically from coding end.
- Background Color is not 100 percent white !!!
- how to set indicator's width to the textview's width
- Changing stl_defaultTabTextSize programmatically
- Nested Tabs
- Only works for 2 tabs. the 3rd tab does not render content HOT 1
- Me HOT 1
- H
- how to unselect all tab?
- Viewpager2 not supported
- How Do I disable scrolling right and left.
- 指示线跟文字根本不匹配 HOT 1
- Doesn't inherit font style from theme an style xml file
- How to get Indicator Thickness Trick 1 style for the tab buttons. HOT 1
- How do I set up icons instead of letters?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarttablayout.