Build responsive Android layouts that automatically wrap items to new lines based on screen size.
Create scrollable lists with flexible item sizing using RecyclerView without writing custom layout logic.
Design adaptive UIs where buttons, cards, or images grow and shrink to fill available space.
FlexboxLayout is a Kotlin/Java library for Android that brings the flexible box layout model, a system originally from web CSS, to Android applications. Flexbox is a way to arrange items in a container so that they can grow, shrink, and wrap onto new lines in a controlled way, making it easier to build responsive layouts without hard-coding exact positions. The library provides two ways to use it. The first is FlexboxLayout, a view container that works like Android's built-in LinearLayout or RelativeLayout, where you define the layout in XML or code and items are arranged at once. The second is FlexboxLayoutManager, which is designed to work inside a RecyclerView, Android's component for displaying long scrollable lists. Using FlexboxLayoutManager has the advantage of recycling off-screen views for reuse as the user scrolls, which uses significantly less memory when displaying many items. Both approaches support the main flexbox attributes such as controlling the direction items flow, whether items wrap to new lines, how items are aligned along both axes, and how individual items can grow or shrink relative to their siblings. The library is installed as a dependency via a build configuration file.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.