# AndroidScreenMatch **Repository Path**: yemesoft/android-screen-match ## Basic Information - **Project Name**: AndroidScreenMatch - **Description**: 零负担适配常用设备屏幕 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-29 - **Last Updated**: 2026-06-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Android Screen Match 屏幕适配方案 本项目采用基于 **Smallest Width (sw)** 的 Android 屏幕适配方案,通过自动生成多套 dimens 资源文件,实现不同分辨率设备的自适应布局。 ## 快速开始 ### 依赖引用 在项目根目录的 `build.gradle` 中添加仓库: ```groovy repositories { mavenCentral() maven { url 'https://jitpack.io' } } ``` 在 app 模块的 `build.gradle` 中添加依赖: ```groovy dependencies { implementation 'com.gitee.yemesoft:android-screen-match:1.1' } ``` ## 设计图尺寸与 Dimen 对应关系 **一句话总结:** 将设计图缩放到 **720px 宽度**,获得的尺寸 xxx,对应的 dp/sp 值就是 `@dimen/dl_(dp|sp)(_m)_xxx`。 ### 转换示例 | 设计图标注(720px宽度) | Dimen引用 | 实际值(sw360dp) | |------------------------|-----------|-------------------| | 4px | `@dimen/dl_dp_4` | 2dp | | 3px | `@dimen/dl_dp_3` | 1.5dp | | 2px | `@dimen/dl_dp_2` | 1dp | | 1px | `@dimen/dl_dp_1` | 0.5dp | | -2px | `@dimen/dl_dp_m_2` | -1dp | | 28px(字体) | `@dimen/dl_sp_28` | 14sp | ### 在布局文件中使用 ```xml