Giter VIP home page Giter VIP logo

Comments (8)

mmin18 avatar mmin18 commented on August 16, 2024 3

Check https://github.com/mmin18/FlexLayout/tree/dev (upgrade to v1.2.3)

from flexlayout.

mmin18 avatar mmin18 commented on August 16, 2024

Could you use android:minWidth, android:maxWidth?

from flexlayout.

Piasy avatar Piasy commented on August 16, 2024

I can, but they are far less powerful :(

For example, I have a single line TextView, it need a drawable at its right, the TextView's width should be wrap_content (to let the drawable stay together with text), but should have a max width. I hope I can set its max width according to parent width, to let it expand as wide as possible.

I have to set max width in Java code.

from flexlayout.

mmin18 avatar mmin18 commented on August 16, 2024

I see. There is two ways to express: app:layout_width="max(wrap_content, 100%-this.left-icon.left)" or I can add 4 new params app:layout_minWidth ...
The first one is more universal and flexible, and the second one is more easy to understand. Which one do you prefer?

from flexlayout.

Piasy avatar Piasy commented on August 16, 2024

Great! First one is awesome enough, it shows the power of FlexLayout again!

A little suggestion, that usage could be added into documentation :)

from flexlayout.

Piasy avatar Piasy commented on August 16, 2024

But it seems FlexLayout doesn't support wrap_content inside max function? I use 1.2.2, the IDE preview gives an error:

java.lang.IllegalArgumentException: unknown token wrap_content, layout_width=max(wrap_content, 100% - this.left - icon.left)

Is it just a IDE preview bug?

from flexlayout.

mmin18 avatar mmin18 commented on August 16, 2024

No I haven't implemented it yet.

from flexlayout.

Piasy avatar Piasy commented on August 16, 2024

Got it.

from flexlayout.

Related Issues (14)

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.