# hongyangandroid/androidautolayout

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hongyangandroid-androidautolayout).**

6,684 stars · 1,889 forks · Java · apache-2.0

## Links

- GitHub: https://github.com/hongyangAndroid/AndroidAutoLayout
- Homepage: http://blog.csdn.net/lmj623565791/article/details/49990941
- awesome-repositories: https://awesome-repositories.com/repository/hongyangandroid-androidautolayout.md

## Description

AndroidAutoLayout is an Android library that converts pixel values from design mockups into percentage-based layouts, enabling consistent scaling across different screen resolutions. At its core, it functions as a pixel-to-percentage converter and screen resolution scaling tool, allowing developers to design layouts using exact pixel dimensions from mockups and have them automatically adapt to any target device.

The library provides several distinctive approaches to screen adaptation. It can generate resolution-specific dimension resource files from a single baseline design, eliminating manual calculations for multiple screen sizes. It also supports per-view dimension overrides, where a view's height or width can be forced to scale relative to the opposite screen dimension for equal physical sizes across devices. For scrolling lists, it automatically sizes RecyclerView and ListView items by converting pixel dimensions to percentage-based values. Custom views can be extended with auto-layout logic so their children also support pixel-based sizing, and existing view hierarchies can be wrapped with auto-layout through a single utility method call.

The library covers percentage-based layout design, where view dimensions are defined as fractions of screen width and height to maintain proportional sizing across diverse device resolutions. It also provides accurate layout previewing by selecting a preview device that matches the mockup's resolution. The documentation and installation surface includes the ability to generate dimension resource files for each target screen resolution from a single baseline file.

## Tags

### Mobile Development

- [Screen Adaptation Utilities](https://awesome-repositories.com/f/mobile-development/android-layout-components/screen-adaptation-utilities.md) — Converts pixel values from design mockups into percentage-based layouts for consistent scaling across Android screen resolutions.
- [Auto-Layout Libraries](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-libraries/auto-layout-libraries.md) — Converts pixel values from design mockups into percentage-based layouts for consistent scaling across screen resolutions.
- [Layout Scaling Utilities](https://awesome-repositories.com/f/mobile-development/resolution-scaling-coefficients/layout-scaling-utilities.md) — Scales view dimensions proportionally across different screen sizes using percentage-based calculations from a reference design.

### Development Tools & Productivity

- [Pixel Analysis](https://awesome-repositories.com/f/development-tools-productivity/screen-capture-utilities/pixel-analysis.md) — Accepts pixel dimensions directly from design mockups and scales them automatically across different screen resolutions. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))
- [Pixel-to-Relative](https://awesome-repositories.com/f/development-tools-productivity/unit-converters/pixel-to-relative.md) — Converts design mockup pixel values into percentage-based layout dimensions at compile time for proportional scaling.
- [Pixel-to-Percentage Converters](https://awesome-repositories.com/f/development-tools-productivity/unit-converters/pixel-to-relative/pixel-to-percentage-converters.md) — Converts fixed pixel measurements from design mockups into percentage values that adapt to any target screen resolution.
- [Percentage-Based Screen Layouts](https://awesome-repositories.com/f/development-tools-productivity/window-managers/split-screen-layouts/percentage-based-screen-layouts.md) — Defines view dimensions as fractions of screen width and height for proportional scaling across devices. ([source](http://blog.csdn.net/lmj623565791/article/details/45460089))
- [Resolution-Specific Generation](https://awesome-repositories.com/f/development-tools-productivity/dependency-resolution/stylesheet/resolution-specific-generation.md) — Generates resolution-specific dimension resource files from a single baseline design for multiple screen sizes. ([source](http://blog.csdn.net/lmj623565791/article/details/45460089))
- [Android Dimension Resource Generators](https://awesome-repositories.com/f/development-tools-productivity/dependency-resolution/stylesheet/resolution-specific-generation/android-dimension-resource-generators.md) — Generates resolution-specific dimension resource files from a single baseline design for multiple screen sizes.
- [Android Dimension Resource Generators](https://awesome-repositories.com/f/development-tools-productivity/documentation-generators/data-file-generators/android-dimension-resource-generators.md) — Generates dimension resource files for each target screen resolution from a single baseline file. ([source](http://blog.csdn.net/lmj623565791/article/details/45460089))

### User Interface & Experience

- [Android Auto-Layout Extensions](https://awesome-repositories.com/f/user-interface-experience/auto-layout-wrappers/android-auto-layout-extensions.md) — Provides a mechanism to extend any custom Android view with automatic pixel-to-percentage layout conversion.
- [Android Auto-Layout Injectors](https://awesome-repositories.com/f/user-interface-experience/auto-layout-wrappers/android-auto-layout-injectors.md) — Wraps existing view hierarchies with auto-layout logic through a single utility method call for pixel-based sizing.
- [Screen Percentage Layouts](https://awesome-repositories.com/f/user-interface-experience/grid-layouts/windowed-grids/fluid-percentage-grids/screen-percentage-layouts.md) — Defines view dimensions as fractions of screen width and height for proportional sizing across diverse device resolutions.
- [Auto-Layout Custom View Extensions](https://awesome-repositories.com/f/user-interface-experience/programmatic-element-construction/android-view-lifecycle-tracking/custom-view-rendering/custom-view-orchestration/auto-layout-custom-view-extensions.md) — Adds automatic pixel-to-percentage conversion to any custom view by overriding its layout parameter generation. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))
- [Screen Percentage Sizing](https://awesome-repositories.com/f/user-interface-experience/resizable-panes/dimension-controllers/minimum-dimension-calculators/dimension-constraints/screen-percentage-sizing.md) — Defines view dimensions as fractions of screen width and height for proportional sizing across device resolutions.
- [Custom View Wrappers](https://awesome-repositories.com/f/user-interface-experience/auto-layout-management/custom-view-wrappers.md) — Wraps custom views with auto-layout logic so their children support pixel-based sizing and screen scaling.
- [List Item Sizers](https://awesome-repositories.com/f/user-interface-experience/component-sizing-utilities/link-sizing/size-retrievers/list-item-sizers.md) — Automatically sizes RecyclerView and ListView items by converting pixel dimensions to percentage-based values.
- [Auto-Sized List Items](https://awesome-repositories.com/f/user-interface-experience/form-builders/builder-item-collapsers/builder-item-managers/list-item-markers/auto-sized-list-items.md) — Converts pixel values to percentages for item views inside scrolling lists with a single utility call. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))
- [RecyclerView Item Auto-Sizing](https://awesome-repositories.com/f/user-interface-experience/form-builders/builder-item-collapsers/builder-item-managers/list-item-markers/item-to-item-similarity/recyclerview-item-auto-sizing.md) — Automatically sizes RecyclerView and ListView items by converting pixel dimensions to percentage-based values.
- [Auto-Sized List Items](https://awesome-repositories.com/f/user-interface-experience/navigation-links/custom-navigation-items/item-mapping-adapters/auto-sized-list-items.md) — Scales individual items inside scrolling lists by applying automatic pixel conversion to each inflated view. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))
- [Resolution Resource Generators](https://awesome-repositories.com/f/user-interface-experience/resizable-panes/dimension-controllers/minimum-dimension-calculators/uniform-dimension-calculators/resolution-resource-generators.md) — Creates resolution-specific dimension resource files from a single baseline design, eliminating manual calculations.
- [Dimension Reference Overrides](https://awesome-repositories.com/f/user-interface-experience/view-metadata-overrides/dimension-reference-overrides.md) — Ships per-view dimension overrides that force scaling relative to the opposite screen dimension for consistent physical sizes.
- [Auto-Sized List Items](https://awesome-repositories.com/f/user-interface-experience/view-recycling-systems/type-based-item-recycling/auto-sized-list-items.md) — Scales individual item views inside scrolling lists automatically with a single utility call. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))

### Web Development

- [Dimension Reference Overrides](https://awesome-repositories.com/f/web-development/sizing-unit-systems/relative-layout-dimensions/dimension-reference-overrides.md) — Forces a layout dimension to scale relative to screen width or height instead of its default reference axis. ([source](https://cdn.jsdelivr.net/gh/hongyangandroid/androidautolayout@master/README.md))
