Comments (4)
It requires API lvl 26, but works fine. Thank you very much!
from fliptabs.
The TextView
s in FlipTab can be acccessed using getTextViews()
fn, which can then be used to assign the attributes you require.
Something along the following lines should work,
fliptab.getTextViews().map {
it.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize)
it.setPadding(leftPadding, topPadding, rightPadding, bottomPadding)
}
from fliptabs.
Thank you very much for your answer. It works for paddings, but still I can not set text size lower than 8sp. I think it is because of attribute app:autoSizeMinTextSize="8sp"
in tab_right
and tab_left
. In sample code that you wrote above I've added also something like
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(textView, 1, 17, 1, TypedValue.COMPLEX_UNIT_SP)
but it doesn't change anything. Do you have any advice for setting text size lower than 8sp?
from fliptabs.
You could try disabling the auto-size handling before setting the text size.
fliptab.getTextViews().map {
it.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_NONE)
it.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize)
it.setPadding(leftPadding, topPadding, rightPadding, bottomPadding)
}
from fliptabs.
Related Issues (6)
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 fliptabs.