在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):usefulness/easylauncher-gradle-plugin开源软件地址(OpenSource Url):https://github.com/usefulness/easylauncher-gradle-plugin开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):Easylauncher gradle plugin for AndroidModify the launcher icon of each of your app-variants using simple Gradle rules. Add ribbons of any color, overlay your own images, customize it according to your needs!
This library heavily relies on the original Akaita's easylauncher plugin, but introduces supports for modern build tools and Vector icons UsageBasic usage// in app/build.gradle
plugins {
id "com.starter.easylauncher" version "${{version}}"
} see Gradle Plugin Portal for the details What should I do if I get `Could not resolve all artifacts` error?In some configurations a dependency resolution error might be thrown with a message:
As a solution apply the plugin to the root project using: // in root project's build.gradle
buildscript {
repositories.google()
}
plugins {
id "com.starter.easylauncher" version "${{version}}" apply false
} then apply the plugin in your application module: // in app/build.gradle
plugins {
id "com.starter.easylauncher"
} See related issue for more information. Advanced usageBy default, the plugin applies green ribbon for all debuggable build variants. You can customize the filters applied to each type, flavor and variant of your app. Imagine these are the type and flavors of your app: // in app/build.gradle
android {
buildTypes {
debug {
//Debuggable, will get a default ribbon in the launcher icon
}
beta {
//Debuggable, will get a default ribbon in the launcher icon
debuggable true
}
canary {
//Non-debuggable, will not get any default ribbon
debuggable false
}
release {
//Non-debuggable, will not get any default ribbon
}
}
productFlavors {
local {}
qa {}
staging {}
production {}
}
} You could customize the plugin's behaviour like this: easylauncher {
defaultFlavorNaming true // Use flavor name for default ribbon, instead of the type name
productFlavors {
local {}
qa {
// Add one more filter to all `qa` variants
filters redRibbonFilter()
}
staging {}
production {}
}
buildTypes {
beta {
// Add two more filters to all `beta` variants
filters = [
customRibbon(ribbonColor: "#0000FF"),
overlayFilter(file("example-custom/launcherOverlay/beta.png"))
]
}
canary {
// Remove ALL filters to `canary` variants
enable false
}
release {}
}
variants {
productionDebug {
// OVERRIDE all previous filters defined for `productionDebug` variant
filters = orangeRibbonFilter("custom")
}
}
} Providing Icon NamesBy default, the plugin automatically discovers launcher icon and applies provided filters. easylauncher {
iconNames = ["@mipmap/custom_launcher_icon"] // optional, disables automatic launcher icon discovery and will use provided icons only
buildTypes {
beta {
// icon names can also be provided per each configuration (buildType, productFlavor or variant)
iconNames = ["@mipmap/beta_launcher"]
}
}
} Available filtersOverlay filter
Ribbon filtersAdvanced Ribbon filterTroubleshooting on "Problem reading font data."When using docker or a minimalistic environment one might encounter above error message when loading Fonts.
See related issue for more information. Chrome-like filtersAvailable options
RequirementsMinimal requirements for the plugin are:
Project Structure
CreditsCredits to Akaita's easylauncher plugin which this project heavily relies on |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论