Recycler view items take its width and can continue with new row

Viewed 77

is there any way to make a design like this (image)

EXPLANATION: List of items where item take its width if screen widths are not fit so continue in next row.

Item(2) starts after the item(1) and continues in the next row.

Items will be textviews

enter image description here

flexlayout has limit if item will not fully fit it make it in another row

Edit:

(Assume Case ) assume I have two texts and want to display them for ex text1 = "Hello ", text2 = "Ahmed" and screen width can fit 8 character so UI should be

Hello A

hmed

[Actual Case]

enter image description here

here there are two texts , first with below background and second without this is final UI

2 Answers

A small example for assuming the case

input: Hello Ahmed

expected output :Hello A

hmed

You can store a list of strings into single string. Make text view height wrap content using Spanable string, you can have more control on text.

You can achieve that by adding android:scrollHorizontally="false" to the TextView xml that is displaying the text.

<TextView
.
.
.
android:scrollHorizontally="false" />
Related