Files
Martin Guillon c9e87e87f9 fix: android support for clipToBounds
It comes with a major refactoring of the BorderDrawable. Now all Paths are cached not to regenerate them on every draw pass.

Also it is important to understand that the clipping feature on android comes at a cost.
It will be done only when truelly necessary. but with complex paths ((border radius > 0 && border non uniform) || border-width >0) then we must apply a costly drawing pass (though hardware accelerated) to accomplish it.
2021-08-11 13:41:21 +02:00

109 lines
2.4 KiB
Groovy

import groovy.json.JsonSlurper //used to parse package.json
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
def isWinOs = System.properties['os.name'].toLowerCase().contains('windows')
apply plugin: 'com.android.library'
def computeCompileSdkVersion () {
if(project.hasProperty("compileSdk")) {
return compileSdk
}
else {
return 28
}
}
def computeBuildToolsVersion() {
if(project.hasProperty("buildToolsVersion")) {
return buildToolsVersion
}
else {
return "28.0.2"
}
}
def computeAndroidXVersion() {
if(project.hasProperty("androidxVersion")) {
return androidxVersion
}
else {
return "1.0.0"
}
}
def computeSupportVersion() {
if(project.hasProperty("supportVersion")) {
return supportVersion
}
else {
return "28.0.0"
}
}
def computeTargetSdkVersion() {
if(project.hasProperty("targetSdk")) {
return targetSdk
}
else {
return 28
}
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion computeCompileSdkVersion()
buildToolsVersion computeBuildToolsVersion()
defaultConfig {
minSdkVersion 16
targetSdkVersion computeTargetSdkVersion()
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
if(project.hasProperty("useAndroidX")) {
println 'Using android X'
def androidxVersion = computeAndroidXVersion()
implementation 'androidx.viewpager:viewpager:' + androidxVersion
implementation 'androidx.fragment:fragment:' + androidxVersion
implementation 'androidx.transition:transition:' + androidxVersion
implementation "androidx.exifinterface:exifinterface:1.3.2"
} else {
println 'Using support library'
implementation 'com.android.support:support-v4:' + computeSupportVersion()
}
}
task cleanBuildDir (type: Delete) {
delete "../build/"
}
task copyAar {
doLast {
copy {
from "build/outputs/aar/widgets-release.aar"
into "../build/"
}
}
}
assemble.dependsOn(cleanBuildDir)
copyAar.dependsOn(assemble)
build.dependsOn(copyAar)