Questions tagged [android-flexboxlayout]

FlexboxLayout is a library project which brings the similar capabilities of CSS Flexible Box Layout Module to Android.

74 questions
3
votes
0 answers

Is it possible to restrict specific rows in FlexboxLayoutManager of RecyclerView?

Background I need to create a UI of a details screen, which includes various fields, in a list fashion. This is why I chose to use RecyclerView, because there could be a lot of fields and I don't want that all views will be inflated from start. The…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
3
votes
1 answer

Use FlexboxLayout programmatically

I'm facing some problems trying to create a simple interface using FlexboxLayout. I create the view in .xml file and all works as expected, but when I try to create the same view programmatically, I'm not be able to set the…
Iván Ferrant
  • 161
  • 3
  • 9
3
votes
1 answer

Breaking to new line in FlexboxLayout

I am using a FlexboxLayout to add few EditTexts. Each EditText contains just 1 character of words.I am using editText for space as well but keeping it invisible.I am using layout setting FlexWrap as "wrap". For instance, if I have two words, some…
3
votes
1 answer

Android Flexbox setFlexBasisPercent not working

I'm using android's now layout - FlexboxLayout. When I add some view to FlexboxLayout programmatically, FlexboxLayout.setWidth( int ) is working but FlexboxLayout.setFlexBasisPercent( float ) not. Why!!! I can't understand. Here is my…
user6514354
3
votes
2 answers

Count number of rows in flexbox

In my android application i have used flexbox-layout. I am adding buttons dynamically into the flexbox. I need to know how many rows are currently rendered (How many rows flexbox created to show the buttons) This is my…
3
votes
1 answer

How to use weight in FlexboxLayout to center 3 linear layouts?

I have a FlexboxLayout and inside it I have 3 LinearLayout's that I want to center with the same width and height, however they are with different width's. How can I center they in FlexboxLayout? Here is my XML code: …
Luiz Fernando Salvaterra
  • 4,192
  • 2
  • 24
  • 42
3
votes
0 answers

Android FlexboxLayout usage

I have created a simple application having a sequence of child Views using LinearLayout with orientation="horizontal", and manually calculate the device width and once the child item cross the device width, then i am changing the height to hold the…
Logo
  • 1,366
  • 2
  • 11
  • 16
3
votes
0 answers

Performance comparison of FlexboxLayout with LinearLayout or RelativeLayout?

The immediate advantage I see is reduced View hierarchy but I couldn't help notice that it will need multiple passes during onMeasure(), in this scenario how does the performance of FlexboxLayout compare with RelativeLayout and others? Note: The…
Arif Nadeem
  • 8,524
  • 7
  • 47
  • 78
3
votes
1 answer

Android Google FlexboxLayout : get lines or columns number

I am using the Google's FlexboxLayout Android library. I'm searching how to get the number of rows (when the flexDirection property is set to row or row_reverse) or columns (when the flexDirection property is set to column or column_reverse).
Yairopro
  • 9,084
  • 6
  • 44
  • 51
3
votes
1 answer

android : flexbox not wrapping content

I am using this flexbox layout. I am stuck getting a behavior. I want items to be displayed to next line if dynamically added items cannot fit in FlexboxLayout. Flexbox Version: 0.2.2 Below is my XML code:
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174
2
votes
2 answers

Is it possible to have fixed number of columns with android flexbox layout

I am trying to replace my existing GridLayout with flexbox layout. I have a layout that requires me to have exactly 4 columns and two rows. Only way I have found this to work is by code val rootFlexboxLayout = binding.moreActionLayout …
Subodh Nijsure
  • 3,305
  • 5
  • 26
  • 45
2
votes
1 answer

Horizontal RecyclerView with dynamic item height

I am trying to create a horizontal recycler view with dynamic height by following this stack overflow post. The solution seems working. But the recycler view items disappear when I try to remove an item from recycler view. recyclerview layout: …
Suneesh Ambatt
  • 1,347
  • 1
  • 11
  • 41
2
votes
1 answer

Android Recyclerview with Viewholder changing width and height onClick

I want to create a RecyclerView in Android which contains ViewHolders, that change their width and height as shown in the GIF below. I tried several LayoutManagers for the RecyclerView but I did not manage to get the result I wished for. The…
2
votes
3 answers

Android FlexboxLayoutManager recreating items

I am using FlexboxLayoutManager to display Recycler View items with dynamic width. The problem I'm facing is when the background of the item is changed it reanimates/redraw all the next items which are not very attractive/required. The following…
Adam
  • 1,303
  • 11
  • 26
2
votes
2 answers

Adding "FlexBoxLayout" to a project breaks compilation

I am trying to use FlexBoxLayout in my app, but I am running into errors continuously. I have tried all kinds of settings and configs, but different errors keep popping up. What I have now: build.gradle (app): dependencies { implementation…
Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195