This commit is contained in:
coco
2026-07-03 15:56:07 +08:00
commit caef23209c
5767 changed files with 1004268 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/build
+27
View File
@@ -0,0 +1,27 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion rootProject.targetSdkVersion
buildToolsVersion "29.0.3"
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName rootProject.williamchartVersion
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$rootProject.kotlinVersion"
implementation project(path: ':williamchart')
}
apply from: 'publish.gradle'
+62
View File
@@ -0,0 +1,62 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
version rootProject.williamchartVersion
group 'com.diogobernardino.williamchart'
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/slidertooltip-release.aar")
artifact sourcesJar
groupId this.group
artifactId 'tooltip-slider'
version this.version
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
bintray {
Properties properties = new Properties()
File localPropertiesFiles = project.rootProject.file('local.properties')
if (localPropertiesFiles.exists())
properties.load(localPropertiesFiles.newDataInputStream())
user = properties.containsKey('bintrayUser') ? properties.getProperty('bintrayUser') : System.getenv('BINTRAY_USER')
key = properties.containsKey('bintrayApiKey') ? properties.getProperty('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['Production']
configurations = ['archives']
// Default: false. Whether to run this as dry-run, without deploying
dryRun = false
// Default: false. Whether to override version artifacts already published
override = false
// Default: false. Whether version should be auto published after an upload
publish = true
pkg {
repo = 'maven' // the name of the repository you created on Bintray
name = 'com.diogobernardino.williamchart:tooltip-slider'
// the name of the package you created inside it
version {
name = this.version
released = new Date()
vcsTag = this.version
}
}
}
@@ -0,0 +1 @@
<manifest package="com.db.williamchart.slidertooltip" />
@@ -0,0 +1,32 @@
package com.db.williamchart.slidertooltip
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.db.williamchart.ExperimentalFeature
import com.db.williamchart.Tooltip
@ExperimentalFeature
class SliderTooltip : Tooltip {
private lateinit var tooltipView: View
var color = Color.BLACK
override fun onCreateTooltip(parentView: ViewGroup) {
tooltipView =
LayoutInflater.from(parentView.context)
.inflate(R.layout.tooltip_layout, parentView, false)
tooltipView.setBackgroundColor(color)
tooltipView.visibility = View.INVISIBLE
parentView.addView(tooltipView)
}
override fun onDataPointTouch(x: Float, y: Float) {
tooltipView.visibility = View.VISIBLE
tooltipView.x = x - tooltipView.width / 2
}
override fun onDataPointClick(x: Float, y: Float) {}
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="2dp"
android:layout_height="match_parent" />