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/pointstooltip-release.aar")
artifact sourcesJar
groupId this.group
artifactId 'tooltip-points'
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-points'
// 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.pointtooltip" />
@@ -0,0 +1,35 @@
package com.db.williamchart.pointtooltip
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.db.williamchart.Tooltip
class PointTooltip : Tooltip {
private lateinit var tooltipView: View
@Suppress("MemberVisibilityCanBePrivate")
var drawableRes = R.drawable.circle_point
override fun onCreateTooltip(parentView: ViewGroup) {
tooltipView =
LayoutInflater.from(parentView.context)
.inflate(R.layout.point_tooltip_layout, parentView, false)
tooltipView.visibility = View.INVISIBLE
val imageView: ImageView = tooltipView.findViewById(R.id.tooltipImage)
imageView.setImageResource(drawableRes)
parentView.addView(tooltipView)
}
override fun onDataPointTouch(x: Float, y: Float) {}
override fun onDataPointClick(x: Float, y: Float) {
tooltipView.visibility = View.VISIBLE
tooltipView.x = x - tooltipView.width / 2
tooltipView.y = y - tooltipView.height / 2
}
}
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#000" />
<size
android:width="10dp"
android:height="10dp" />
</shape>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tooltipImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />