Giter VIP home page Giter VIP logo

dimensplugin's Introduction

DimensPlugin

不再维护,请切换到https://github.com/zcys12173/ScreenMatchPlugin

1.自动提取资源文件中的dp,sp到dimens.xml中,
2. 根据配置生成适配dimens文件

添加依赖

最外层的build.gralde中添加 buildscript {
dependencies {
classpath 'com.syc.plugin:resource:0.0.1'
}
}
Image text 在app/module工程的build.gradle中添加下面内容
apply plugin: "com.syc.plugin.DimensPlugin"

生成适配文件配置

以最小宽度规则生成dimens.xml文件
app/module工程的build.gradle中添加下面内容
dimensConfig {
baseSize=375//基准(值为屏幕的宽度dp值)
matchSizes=[320,360]//所需适配的尺寸(值为屏幕的宽度dp值)
}
Image text

使用方法

1.提取xml中的dp sp值
gradle app:pickDimens
2.根据配置生成适配文件
gradle app:createMatchFiles

在右侧的gradle task列表中的dimens下可找到对应的task
Image text

dimensplugin's People

Contributors

zcys12173 avatar

Stargazers

 avatar 小懒猴 avatar  avatar Zone avatar Laya avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.