Coder Social home page Coder Social logo

Comments (4)

Queike avatar Queike commented on July 22, 2024 1

It requires API lvl 26, but works fine. Thank you very much!

from fliptabs.

Chrisvin avatar Chrisvin commented on July 22, 2024

The TextViews 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.

Queike avatar Queike commented on July 22, 2024

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.

Chrisvin avatar Chrisvin commented on July 22, 2024

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 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.