# 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-22 ## 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.2' } ``` ## 设计图尺寸与 Dimen 对应关系 **一句话总结:** 将设计图缩放到 **1200px 宽度**,获得的尺寸 xxx,对应的 dp/sp 值就是 `@dimen/dl_(dp|sp)(_m)_xxx`。 ### 转换示例 | 设计图标注(1200px宽度) | Dimen引用 | 实际值(sw360dp) | |------------------------|-----------|-------------------| | 10px | `@dimen/dl_dp_10` | 3.00dp | | 20px | `@dimen/dl_dp_20` | 6.00dp | | 100px | `@dimen/dl_dp_100` | 30.00dp | | 200px | `@dimen/dl_dp_200` | 60.00dp | | -10px | `@dimen/dl_dp_m_10` | -3.00dp | | 28px(字体) | `@dimen/dl_sp_28` | 8.40sp | ### 在布局文件中使用 ```xml