Comments (12)
Thanks for the suggestion, but I don't come up with an use case where the maxLines attribute is useful. Like what use case do you expect that attribute?
from flexbox-layout.
First issue I had when I tried FlexBoxLayout. It would be helpful if we had this attribute. In my case I have a FlexBoxLayout on top of a RecyclerView. The FlexBoxLayout shows the names of the selected elements in the list. In my case I don't want it to be more than two lines (otherwise the FlexBox would cover the screen if I select many elements), I would show a label "+N" for the rest of the selected items.
from flexbox-layout.
@thagikura It should be maxVisibleLines
, not maxLines
from flexbox-layout.
manager.setMaxLine(1) is useless for FlexboxLayoutManager.
private static class OnViewGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener {
private final static int maxHeight = 130;
private View view;
public OnViewGlobalLayoutListener(View view) {
this.view = view;
}
@Override
public void onGlobalLayout() {
if (view.getHeight() > maxHeight)
view.getLayoutParams().height = maxHeight;
}
}
add listener to RecyclerView:
view.getViewTreeObserver()
.addOnGlobalLayoutListener(new OnViewGlobalLayoutListener(view));
from flexbox-layout.
It would be useful in my case too.
Could you please provide any ETA for this issue?
from flexbox-layout.
I wanted to be careful for adding a feature that the original Flexbox doesn't have, but it looks like this is going to be useful for a lot of developers.
I'll add this feature on my TODO list.
from flexbox-layout.
Same problem, i only need one line in header of RecyclerView
from flexbox-layout.
what about this functionality?
from flexbox-layout.
So, no progress with this?
from flexbox-layout.
Same problem, not only and
add enqueue child view to pop old child view also limit flexboxlayout max lines
from flexbox-layout.
Also looking for this feature. I noticed that this issue is closed but it references another issue which is also closed and references this issue. Maybe you should leave this one open since it hasn't been implemented yet.
My use case is that I have is a list of items which could have only a few items or dozens. In the latter case, I don't want it to fill the entire screen and therefore need a limit to how many lines are shown.
from flexbox-layout.
How do I use maxLine
whilst preserving item widths? I am essentially trying to achieve the above; add all items to wrap but only show the first line but setting maxLine
squishes all items onto 1 line
Seems related to #440
from flexbox-layout.
Related Issues (20)
- Flexbox layout manager not scrollable
- indexInFlexLine is not consistent in onNewFlexItemAdded() method
- Android Studio Integration
- Add gap attribute HOT 3
- Wrong placement
- FlexboxLayoutManager.computeScrollOffset(); It is wrong to be equal to 0 HOT 1
- [FE] page 분기처리
- RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen) HOT 4
- ComposeView in flexbox crashes, because it is not attached when measured
- FlexboxLayoutManager child item margin is wrong when flex-direction is column
- How can i use this library in jetpack compose HOT 2
- Flaxbaox layout
- Playground doesn't build in latest Android Studio Flamingo HOT 3
- FlexboxLayoutManager does not recycle views with Navgraph HOT 3
- Is there possible to set "needsToFill" not only mContext.getResources().getDisplayMetrics().heightPixels?
- java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1 HOT 1
- FlexBoxLayoutManager with RecyclerView causes multiple items to refresh on calling notifyItemChanged
- First party support for Compose UI
- Support for Constraints of Rows & Columns
- Setting flex box percent to zero behaves differently than in CSS
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 flexbox-layout.