Questions tagged [android-flexboxlayout]

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

74 questions
20
votes
2 answers

Centering RecyclerView items with FlexboxLayoutManager

How do I center all my RecyclerView items using the FlexboxLayoutManager? I need the items to be centered like this: I tried without success: My code where I set the layout manager: val layoutManager = FlexboxLayoutManager(this) …
14
votes
6 answers

Horizontal RecyclerView with dynamic item’s Height

I’m trying to implement a RecyclerView with horizontal scrolling, so I’m using this a LinearLayoutManager with horizontal orientation. The problem is that I’m populating the RecyclerView using 2 different types of items, with different heights. This…
9
votes
4 answers

Cannot access ActivityCompatApi23 class

I am having runtime problems with my gradle file. I added this compile 'com.google.android:flexbox:0.3.1' as a compile time dependency to my Gradle file. I encountered an error and added this in my project level Gradle file. maven { url…
6
votes
1 answer

java.lang.NoClassDefFoundError: androidx/core/view/ViewCompat when using FlexboxLayout

I'm using FlexboxLayout Added below dependency in build.gradle of FlexboxLayout dependencies { implementation 'com.google.android:flexbox:1.1.0' } myLayout
Goku
  • 9,102
  • 8
  • 50
  • 81
5
votes
1 answer

FlexboxLayout - Show tag or Chip or label count at the end of second line android

I am using FlexboxLayout for showing chips in android but stuck at UI Where I want to show number of chips count at the end of second line as per below screenshot As per above design I want to show chips until second line and the chips that not fit…
5
votes
1 answer

How to count number of rows, when FlexBoxLayoutManger set as layoutManager for RecyclerView

I am using FlexboxLayoutManager as: FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(this); recyclerView.setLayoutManager(flexboxLayoutManager); Now I have to inflate items in recyclerView and if number of items taking more than…
Anupriya
  • 1,663
  • 3
  • 17
  • 28
4
votes
0 answers

Android FlexBox Layout shows only fixed number of lines

I'm trying to build a word-to-word RTL language ebook application. The data for the ebook is stored in an Sqlite database. After vigorous searching I found Flexbox layout suitable to my need in order to display my data in my required format. The…
4
votes
3 answers

Wrap right-aligned view when there is no space

I have 2 views in a layout - TextView and Button. TextView is aligned/anchored to the left side and the button is to the right side. What I'm trying to achieve is the natural "wrap behavior" of the Button. When TextView will be wide enough so that…
4
votes
3 answers

StaggeredLayout with FlexboxLayoutManager

I there any way to implement a staggered layout using google's Flexbox library similar to this The above layout is created using StaggeredLayoutManger also maintaining the aspect ratio of the image I have tried the code: recyclerView.apply { …
Prithvi Bhola
  • 3,041
  • 1
  • 16
  • 32
4
votes
1 answer

set FlexboxLayout's attribute layout_wrapbefore programmatically

I have flexbox-layout contains TextView that have the attribute: app:layout_wrapBefore="true" but I need to set it to false programmatically! any idea on how to do that? the xml, if needed!
Atef Hares
  • 4,715
  • 3
  • 29
  • 61
3
votes
1 answer

Flexboxlayout Spacing between items programmatically

I've this Flexboxlayout definition (official Google library):
Jumpa
  • 4,319
  • 11
  • 52
  • 100
3
votes
0 answers

Break sentence in recyclerview android

I am using FlexboxLayout manager and recyclerview to show list of sentences. When i am adding sentence into recyclerview if there is no room for whole sentence in left it goes to bottom. Then i want break the sentence and fill available space into…
Niyas
  • 717
  • 11
  • 18
3
votes
1 answer

Flexbox horizontal scroll not working - why?

I want just 3 items centered along with horizontal scroll for remaining items, Also I want the centered item to get highlighted on scroll or tap. Here is what i want I am using flexboxlayout manager and here is what i did flexboxLayoutManager=new…
3
votes
2 answers

RecyclerView items with different heights with FlexboxLayoutManager

How can I display my recycleview items in a row while keeping their original height? I want to use a recycleviewer with FlexboxLayoutManager. Every item normally having their own height depending on their content. However, every recycleview item on…
neqopa
  • 119
  • 1
  • 12
3
votes
2 answers

Android, display a shadow under each items of a RecyclerView (without margin-padding)

I'm trying to display a shadow under items of a RecyclerView but there is no space between items. I'm trying to reproduce something like that : I've implemented a RecyclerView and a FlexboxLayout so items takes the whole place in the screen. Here…
Mickael B.
  • 4,755
  • 4
  • 24
  • 48
1
2 3 4 5