• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tmiyamon/gradle-mdicons: A gradle plugin for Android to handle material design i ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tmiyamon/gradle-mdicons

开源软件地址(OpenSource Url):

https://github.com/tmiyamon/gradle-mdicons

开源编程语言(OpenSource Language):

Groovy 100.0%

开源软件介绍(OpenSource Introduction):

Gradle Material Design Icons Plugin

Android Arsenal Build Status

This plugin will manage Google's official material design icons in your build.gradle. The plugin copies specified icons from the material design icon repository into your application allowing you to focus on the png icons only.

The working sample project is here.

gradle-mdicons-result

Usage

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'com.tmiyamon:gradle-mdicons:0.3.1'
  }
}

repositories {
  jcenter()
}

apply plugin: 'com.android.application'
apply plugin: 'com.tmiyamon.mdicons'

The plugin will clone the material design icons repository to your local environment first, and then refer to it for later builds. The first build will take a while as a result of the clone.

Configuration

mdicons {
    defcolor 'mycolor', '#9804d9'

    assets {
        nav {
            densities "mdpi", "xxxhdpi"
            colors "mycolor", "white"
            sizes  "18dp", "36dp"
            names  "camera", "search"
        }

        toolbar {
            colors "primary", "secondary"
            sizes  "18dp"
            names  "home"
        }
    }

}

Google's material design icons repository follows a naming convention of */drawable-{{density}}/ic_{{name}}_{{color}}_{{size}}dp.png.

The blocks in assets can have any name and you can define colors(required), sizes(required), names(required) and densities(optional) in it, and then the plugin install icons by the combination of them into your project. No specific densities means mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi.

Icon tinting

The icon tinting is supported. The plugin gets the color information from the values of defcolor and the src/main/res/values/colors.xml file. You can use these color names for names in asset block.

At installation of icons, when trying to get a specific color icon fails, the plugin try to convert white one to the color one and install it.

Tasks

installAssets

Install assets with supporting tinting. The destination directory is src/main/res-mdicons which will be automatically added to the resource path set. When successfully installed, the icons will be reffered by R.mipmap. If no problem but you cannot refer them, running gradle processResources may help you.

uninstallAssts

Uninstall assets by deleting destination directory.

listColors

You can check out the available colors for colors in assets block.

syncRepository

Mainly implicitly used but you can explicitly clone or pull the material design repostiory on your system by running this task.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
nrudenko/gradle-android-cq-plugin: README发布时间:2022-06-14
下一篇:
heroku/devcenter-gradle发布时间:2022-06-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap