Junior
How to make a view scale depending on the occupied space (flexible layouts)?
sobes.tech AI
Answer from AI
Use ConstraintLayout with 0dp constraints (MATCH_CONSTRAINT) for width/height and layout_constraintHorizontal_bias / layout_constraintVertical_bias. You can also use LinearLayout with weights (layout_weight).
Other approaches:
RecyclerView/ListViewwith different item types.FlexboxLayoutfrom Google.- Programmatically calculate sizes in
onCreateoronMeasure.