sketchub icon

FlexLayout

SYTStudio
7 Likes
11 Comments
36 Downloads

What's new

READ DESCRIPTION IF U WANT TO UNDERSTAND

Screenshots

About

πŸ’‘ 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