As commented you can use Flexbox LayoutManager with layout_wrapBefore flag on chips 11,21,etc
or it is also possible with a standard recyclerview if you reformat your data.
To do it with a standard recyclerview you need to arrange your data in a 2D data structure, this can be an ArrayList of Arraylists or with Arrays or a set of POJO classes
In the outer Arraylist would be the rows and the inner Arraylist you would have the items to display in the row.
So the RecyclerView item is just a Horizontal Linear Layout to produce the row, to which you add your Chips from the Inner ArrayList
example using a generated 2D structure
MainActivity
public class MainActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private RAdapter adapter;
private ArrayList<ArrayList<String>> rowsArrayList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = (RecyclerView) findViewById(R.id.recycler);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(linearLayoutManager);
rowsArrayList = new ArrayList<>();
for (int i = 1; i <= 3; i++) {
ArrayList<String> row = new ArrayList<>();
for (int j = 1; j <= 10; j++) {
row.add(String.valueOf(j));
}
rowsArrayList.add(row);
}
adapter = new RAdapter(this, rowsArrayList);
recyclerView.setAdapter(adapter);
}
}
RAdapter
public class RAdapter extends RecyclerView.Adapter<RAdapter.RHolder>{
class RHolder extends RecyclerView.ViewHolder {
private LinearLayout line;
public RHolder(View itemView) {
super(itemView);
line = itemView.findViewById(R.id.line);
}
}
private Context context;
private ArrayList<ArrayList<String>> rowsArrayList;
public RAdapter(Context context, ArrayList<ArrayList<String>> rowsArrayList) {
this.context = context;
this.rowsArrayList = rowsArrayList;
}
@Override
public RHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_layout, parent, false);
return new RHolder(view);
}
@Override
public void onBindViewHolder(RHolder holder, int position) {
// Because we might be recycling the LinearLayout that might have had chips added to it already
holder.line.removeAllViews();
ArrayList<String> row = rowsArrayList.get(position);
for (String text: row) {
Chip chip = new Chip(context);
chip.setText(text);
holder.line.addView(chip);
}
}
@Override
public int getItemCount() {
return rowsArrayList.size();
}
}
row_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/line">
</LinearLayout>
This Produces

Update:
With a bit more Maths you can do it without re-arranging the data
Showing 25 items to cover not full row usecase
MainActivity
public class MainActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private RAdapter adapter;
private ArrayList<String> itemsArrayList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = (RecyclerView) findViewById(R.id.recycler);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(linearLayoutManager);
itemsArrayList = new ArrayList<>();
for (int i = 1; i <= 25; i++) {
itemsArrayList.add(String.valueOf(i));
}
adapter = new RAdapter(this, itemsArrayList);
recyclerView.setAdapter(adapter);
}
}
RAdapter
public class RAdapter extends RecyclerView.Adapter<RAdapter.RHolder>{
class RHolder extends RecyclerView.ViewHolder {
private LinearLayout line;
public RHolder(View itemView) {
super(itemView);
line = itemView.findViewById(R.id.line);
}
}
private Context context;
private ArrayList<String> itemsArrayList;
private int itemsPerRow = 10;
public RAdapter(Context context, ArrayList<String> itemsArrayList) {
this.context = context;
this.itemsArrayList = itemsArrayList;
}
@Override
public RHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_layout, parent, false);
return new RHolder(view);
}
@Override
public void onBindViewHolder(RHolder holder, int position) {
// Because we might be recycling the LinearLayout that might have had chips added to it already
holder.line.removeAllViews();
int adjustedPosition = position + 1;
int rangeEnd = Math.min(itemsArrayList.size(), adjustedPosition * itemsPerRow);
int rangeStart = Math.max((position * itemsPerRow) + 1, rangeEnd - itemsPerRow);
for (int i = rangeStart; i <= rangeEnd; i++) {
int arrayPositionAdjusted = i - 1;
Chip chip = new Chip(context);
chip.setText(itemsArrayList.get(arrayPositionAdjusted));
holder.line.addView(chip);
}
}
@Override
public int getItemCount() {
return return (int) Math.ceil(itemsArrayList.size()/ (double) itemsPerRow);
}
}
Produces
