Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ladingwu/dimens_sw
Android UI适配方案
https://github.com/ladingwu/dimens_sw
android android-app
Last synced: 19 days ago
JSON representation
Android UI适配方案
- Host: GitHub
- URL: https://github.com/ladingwu/dimens_sw
- Owner: ladingwu
- Created: 2018-06-13T16:51:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-10T03:16:14.000Z (over 5 years ago)
- Last Synced: 2024-10-16T16:12:33.184Z (about 1 month ago)
- Topics: android, android-app
- Language: Java
- Homepage:
- Size: 450 KB
- Stars: 1,755
- Watchers: 27
- Forks: 393
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
- android ui适配,基于smallestWidth的适配方案
> Tips:大部分手机的宽度dp值集中在320-450之间,大部分1080P的手机应该都是360dp,390dp,411dp。可以在这个基础上,参考Android studio中的Virtual Device Configuration
![](https://github.com/ladingwu/dimens_sw/blob/master/tips.jpg)
## 使用说明
- clone该项目到本地,以Android项目打开。
- DimenTypes文件中写入你希望适配的sw尺寸,默认的这些尺寸能够覆盖几乎所有手机适配需求
- DimenGenerator文件中填写设计稿的尺寸(DESIGN_WIDTH是设计稿宽度,DESIGN_HEIGHT是设计稿高度)
- 执行lib module中的DimenGenerator.main()方法,当前地址下会生成相应的适配文件,把相应的文件连带文件夹拷贝到正在开发的项目中## 希望用真机测试的,可运行app项目看效果(效果如下图)
![](https://github.com/ladingwu/dimens_sw/blob/master/test.png)