READ DESCRIPTION IF U WANT TO UNDERSTAND
π‘ What is FlexLayout?
FlexLayout is a lightweight and dependency-free Android library that automatically scales your entire user interface to match any screen size and density β without duplicating layouts or manually calculating dimensions.
It dynamically adjusts every View in your hierarchy β including width, height, margins, paddings, text size, and even corner radius β based on your defined base design width (in dp). The result: your app looks identical across all devices, from small phones to large tablets.
β¨ Why youβll love it
π§© One layout fits all β no more sw600dp, values-land, or density folders
βοΈ Automatic scaling β proportions remain consistent on any screen
π¨ Font & radius scaling β text and rounded corners scale perfectly
π Zero dependencies β pure Java, no XML attributes or external libs
π‘ Debug overlay β visualize layout scaling in real time
πΎ One-time setup β attach once, FlexLayout handles the rest
π§ How it works
You define your designβs base width (e.g. Pixel 6a = 411 dp), and FlexLayout calculates a proportional scale factor at runtime:
scale = currentScreenWidthDp / baseWidthDp
It then walks through your root layout and automatically adjusts all
All with a single call:
FlexLayout.init(context, 411f); FlexLayout.attach(findViewById(R.id.root));
Made with β€οΈ by SYTStudio
©2025 Sketchub | User Policy