From 562bf39c4aab819348090c8af142d198f0a7f381 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sat, 27 Dec 2025 08:44:18 +0100 Subject: [PATCH] Rename --- .../appdev/chartexample/BarChartActivity.kt | 4 +- .../chartexample/BubbleChartActivity.kt | 4 +- .../HorizontalBarChartActivity.kt | 4 +- .../HorizontalBarNegativeChartActivity.kt | 4 +- .../appdev/chartexample/PieChartActivity.kt | 4 +- .../chartexample/PieChartRoundedActivity.kt | 4 +- .../compose/HorizontalBarComposeActivity.kt | 4 +- .../chartexample/custom/MyMarkerView.kt | 6 +-- .../chartexample/custom/RadarMarkerView.kt | 6 +-- .../custom/StackedBarsMarkerView.kt | 6 +-- .../chartexample/custom/XYMarkerView.kt | 6 +-- .../charting/charts/BarLineChartBase.kt | 32 +++++++------- .../info/appdev/charting/charts/Chart.kt | 16 +++---- .../charting/charts/HorizontalBarChart.kt | 8 ++-- .../info/appdev/charting/charts/PieChart.kt | 10 ++--- .../charting/charts/PieRadarChartBase.kt | 12 +++--- .../appdev/charting/components/Description.kt | 6 +-- .../appdev/charting/components/IMarker.kt | 6 +-- .../appdev/charting/components/MarkerImage.kt | 12 +++--- .../appdev/charting/components/MarkerView.kt | 12 +++--- .../info/appdev/charting/data/BaseDataSet.kt | 6 +-- .../charting/highlight/BarHighlighter.kt | 6 +-- .../charting/highlight/ChartHighlighter.kt | 8 ++-- .../highlight/HorizontalBarHighlighter.kt | 4 +- .../charting/highlight/RadarHighlighter.kt | 4 +- .../dataprovider/base/IBaseProvider.kt | 6 +-- .../charting/interfaces/datasets/IDataSet.kt | 4 +- .../listener/BarLineChartTouchListener.kt | 26 ++++++------ .../listener/PieRadarChartTouchListener.kt | 4 +- .../appdev/charting/renderer/AxisRenderer.kt | 6 +-- .../charting/renderer/BarChartRenderer.kt | 6 +-- .../charting/renderer/BubbleChartRenderer.kt | 6 +-- .../renderer/CandleStickChartRenderer.kt | 6 +-- .../renderer/HorizontalBarChartRenderer.kt | 6 +-- .../charting/renderer/LineChartRenderer.kt | 6 +-- .../charting/renderer/PieChartRenderer.kt | 22 +++++----- .../charting/renderer/RadarChartRenderer.kt | 42 +++++++++---------- .../charting/renderer/ScatterChartRenderer.kt | 6 +-- .../appdev/charting/renderer/XAxisRenderer.kt | 16 +++---- .../XAxisRendererHorizontalBarChart.kt | 14 +++---- .../renderer/XAxisRendererRadarChart.kt | 12 +++--- .../YAxisRendererHorizontalBarChart.kt | 6 +-- .../renderer/YAxisRendererRadarChart.kt | 14 +++---- .../info/appdev/charting/utils/CanvasUtils.kt | 4 +- .../charting/utils/{MPPointD.kt => PointD.kt} | 18 ++++---- .../charting/utils/{MPPointF.kt => PointF.kt} | 30 ++++++------- .../info/appdev/charting/utils/Transformer.kt | 14 +++---- .../info/appdev/charting/utils/Utils.kt | 10 ++--- .../appdev/charting/utils/ViewPortHandler.kt | 4 +- 49 files changed, 241 insertions(+), 241 deletions(-) rename chartLib/src/main/kotlin/info/appdev/charting/utils/{MPPointD.kt => PointD.kt} (51%) rename chartLib/src/main/kotlin/info/appdev/charting/utils/{MPPointF.kt => PointF.kt} (65%) diff --git a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt index be14587b2..efe74040a 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt @@ -26,7 +26,7 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.Fill -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.custom.XYMarkerView import info.appdev.chartexample.databinding.ActivityBarchartBinding @@ -288,7 +288,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect Timber.i("position = $position") Timber.i("x-index low: ${+binding.chart1.lowestVisibleX}, high: ${+binding.chart1.highestVisibleX}") - MPPointF.recycleInstance(position) + PointF.recycleInstance(position) } override fun onNothingSelected() = Unit diff --git a/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt index e51af7272..69fc15490 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt @@ -22,7 +22,7 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBubbleDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.databinding.ActivityBubblechartBinding import info.appdev.chartexample.notimportant.DemoBase @@ -115,7 +115,7 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel val set2 = BubbleDataSet(values2, "DS 2") set2.isDrawIcons = false - set2.iconsOffset = MPPointF(0f, 15f) + set2.iconsOffset = PointF(0f, 15f) set2.setColor(ColorTemplate.COLORFUL_COLORS[1], 130) set2.isDrawValues = true diff --git a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt index e86a97c17..ac88bfef5 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt @@ -21,7 +21,7 @@ import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.databinding.ActivityHorizontalbarchartBinding import info.appdev.chartexample.notimportant.DemoBase @@ -245,7 +245,7 @@ class HorizontalBarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartV Timber.i(bounds.toString()) Timber.i(position.toString()) - MPPointF.recycleInstance(position) + PointF.recycleInstance(position) } override fun onNothingSelected() {} diff --git a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt index 8bfb02eef..e8b884b9c 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt @@ -21,7 +21,7 @@ import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.databinding.ActivityHorizontalbarchartBinding import info.appdev.chartexample.notimportant.DemoBase @@ -241,7 +241,7 @@ class HorizontalBarNegativeChartActivity : DemoBase(), OnSeekBarChangeListener, Timber.i("bounds $bounds") Timber.i("position $position") - MPPointF.recycleInstance(position) + PointF.recycleInstance(position) } override fun onNothingSelected() {} diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt index 70ea85822..6465f4107 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt @@ -27,7 +27,7 @@ import info.appdev.charting.formatter.PercentFormatter import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.databinding.ActivityPiechartBinding import info.appdev.chartexample.notimportant.DemoBase @@ -119,7 +119,7 @@ class PieChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect dataSet.isDrawIcons = false dataSet.sliceSpace = 3f - dataSet.iconsOffset = MPPointF(0f, 40f) + dataSet.iconsOffset = PointF(0f, 40f) dataSet.selectionShift = 5f // add a lot of colors diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt index 2eb686989..5c3dd3383 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt @@ -28,7 +28,7 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.renderer.PieChartRenderer import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.databinding.ActivityPiechartBinding import info.appdev.chartexample.notimportant.DemoBase @@ -120,7 +120,7 @@ class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValu dataSet.isDrawIcons = false dataSet.sliceSpace = 3f - dataSet.iconsOffset = MPPointF(0f, 40f) + dataSet.iconsOffset = PointF(0f, 40f) dataSet.selectionShift = 5f // add a lot of colors diff --git a/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt index ffb9127f0..007b53e3b 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt @@ -46,7 +46,7 @@ import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.chartexample.R import info.appdev.chartexample.notimportant.DemoBaseCompose @@ -281,7 +281,7 @@ class HorizontalBarComposeActivity : DemoBaseCompose() { Timber.tag("bounds $bounds") Timber.tag("position $position") - MPPointF.recycleInstance(position) + PointF.recycleInstance(position) } } diff --git a/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt b/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt index 11094032a..5b4d77edb 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt @@ -7,7 +7,7 @@ import info.appdev.charting.components.MarkerView import info.appdev.charting.data.CandleEntry import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.formatNumber import info.appdev.chartexample.R @@ -31,6 +31,6 @@ class MyMarkerView(context: Context?, layoutResource: Int) : MarkerView(context, super.refreshContent(entry, highlight) } - override var offset: MPPointF = MPPointF() - get() = MPPointF(-(width / 2).toFloat(), -height.toFloat()) + override var offset: PointF = PointF() + get() = PointF(-(width / 2).toFloat(), -height.toFloat()) } diff --git a/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt b/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt index aa803ea06..a4889e30d 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt @@ -7,7 +7,7 @@ import android.widget.TextView import info.appdev.charting.components.MarkerView import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.R import java.text.DecimalFormat @@ -31,6 +31,6 @@ class RadarMarkerView(context: Context, layoutResource: Int) : MarkerView(contex super.refreshContent(entry, highlight) } - override var offset: MPPointF = MPPointF() - get() = MPPointF(-(width / 2).toFloat(), (-height - 10).toFloat()) + override var offset: PointF = PointF() + get() = PointF(-(width / 2).toFloat(), (-height - 10).toFloat()) } diff --git a/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt b/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt index ee6a5c99b..d1343e7de 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt @@ -7,7 +7,7 @@ import info.appdev.charting.components.MarkerView import info.appdev.charting.data.BarEntry import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.formatNumber import info.appdev.chartexample.R @@ -37,6 +37,6 @@ class StackedBarsMarkerView(context: Context?, layoutResource: Int) : MarkerView super.refreshContent(entry, highlight) } - override var offset: MPPointF = MPPointF() - get() = MPPointF(-(width / 2).toFloat(), -height.toFloat()) + override var offset: PointF = PointF() + get() = PointF(-(width / 2).toFloat(), -height.toFloat()) } diff --git a/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt b/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt index 12a672b4a..bc05fdc23 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt @@ -7,7 +7,7 @@ import info.appdev.charting.components.MarkerView import info.appdev.charting.data.Entry import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.chartexample.R import java.text.DecimalFormat @@ -27,6 +27,6 @@ class XYMarkerView(context: Context?, private val xAxisValueFormatter: IAxisValu super.refreshContent(entry, highlight) } - override var offset: MPPointF = MPPointF() - get() = MPPointF(-(width / 2).toFloat(), -height.toFloat()) + override var offset: PointF = PointF() + get() = PointF(-(width / 2).toFloat(), -height.toFloat()) } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt index c219a1f18..fc6a0da41 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt @@ -28,12 +28,12 @@ import info.appdev.charting.listener.BarLineChartTouchListener import info.appdev.charting.listener.OnDrawListener import info.appdev.charting.renderer.XAxisRenderer import info.appdev.charting.renderer.YAxisRenderer -import info.appdev.charting.utils.MPPointD -import info.appdev.charting.utils.MPPointD.Companion.getInstance -import info.appdev.charting.utils.MPPointD.Companion.recycleInstance -import info.appdev.charting.utils.MPPointF -import info.appdev.charting.utils.MPPointF.Companion.getInstance -import info.appdev.charting.utils.MPPointF.Companion.recycleInstance +import info.appdev.charting.utils.PointD +import info.appdev.charting.utils.PointD.Companion.getInstance +import info.appdev.charting.utils.PointD.Companion.recycleInstance +import info.appdev.charting.utils.PointF +import info.appdev.charting.utils.PointF.Companion.getInstance +import info.appdev.charting.utils.PointF.Companion.recycleInstance import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.convertDpToPixel import timber.log.Timber @@ -951,11 +951,11 @@ abstract class BarLineChartBase>?> : ViewGroup, IBase override val xRange: Float get() = mXAxis.mAxisRange - val center: MPPointF + val center: PointF /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. * Returns the center point of the chart (the whole View) in pixels. */ get() = getInstance(width / 2f, height / 2f) - override val centerOffsets: MPPointF + override val centerOffsets: PointF /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. * Returns the center of the chart taking offsets under consideration. * (returns the center of the content rectangle) */ @@ -1165,9 +1165,9 @@ abstract class Chart>?> : ViewGroup, IBase this.highlighter = highlighter } - override val centerOfView: MPPointF + override val centerOfView: PointF /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. */ get() = this.center diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt index d04e1e843..6817a0710 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt @@ -16,8 +16,8 @@ import info.appdev.charting.renderer.HorizontalBarChartRenderer import info.appdev.charting.renderer.XAxisRendererHorizontalBarChart import info.appdev.charting.renderer.YAxisRendererHorizontalBarChart import info.appdev.charting.utils.HorizontalViewPortHandler -import info.appdev.charting.utils.MPPointF -import info.appdev.charting.utils.MPPointF.Companion.getInstance +import info.appdev.charting.utils.PointF +import info.appdev.charting.utils.PointF.Companion.getInstance import info.appdev.charting.utils.TransformerHorizontalBarChart import info.appdev.charting.utils.convertDpToPixel import timber.log.Timber @@ -231,9 +231,9 @@ open class HorizontalBarChart : BarChart { protected var getPositionBuffer: FloatArray = FloatArray(2) /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. */ - override fun getPosition(e: Entry?, axis: AxisDependency?): MPPointF? { + override fun getPosition(e: Entry?, axis: AxisDependency?): PointF? { if (e == null) { return null } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieChart.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieChart.kt index dc01bd972..44e6a0067 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieChart.kt @@ -11,9 +11,9 @@ import info.appdev.charting.data.PieData import info.appdev.charting.highlight.Highlight import info.appdev.charting.highlight.PieHighlighter import info.appdev.charting.renderer.PieChartRenderer -import info.appdev.charting.utils.MPPointF -import info.appdev.charting.utils.MPPointF.Companion.getInstance -import info.appdev.charting.utils.MPPointF.Companion.recycleInstance +import info.appdev.charting.utils.PointF +import info.appdev.charting.utils.PointF.Companion.getInstance +import info.appdev.charting.utils.PointF.Companion.recycleInstance import info.appdev.charting.utils.Utils import info.appdev.charting.utils.convertDpToPixel import java.util.Locale @@ -421,7 +421,7 @@ class PieChart : PieRadarChartBase { return min(circleBox.width() / 2f, circleBox.height() / 2f) } - val centerCircleBox: MPPointF + val centerCircleBox: PointF get() = getInstance(circleBox.centerX(), circleBox.centerY()) fun setCenterTextTypeface(t: Typeface?) { @@ -450,7 +450,7 @@ class PieChart : PieRadarChartBase { mCenterTextOffset.y = y.convertDpToPixel() } - val centerTextOffset: MPPointF + val centerTextOffset: PointF /** * Returns the offset on the x- and y-axis the center text has in dp. */ diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt index 0b25cc2db..a08d5fa2e 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt @@ -13,9 +13,9 @@ import info.appdev.charting.data.ChartData import info.appdev.charting.data.Entry import info.appdev.charting.interfaces.datasets.IDataSet import info.appdev.charting.listener.PieRadarChartTouchListener -import info.appdev.charting.utils.MPPointF -import info.appdev.charting.utils.MPPointF.Companion.getInstance -import info.appdev.charting.utils.MPPointF.Companion.recycleInstance +import info.appdev.charting.utils.PointF +import info.appdev.charting.utils.PointF.Companion.getInstance +import info.appdev.charting.utils.PointF.Companion.recycleInstance import info.appdev.charting.utils.Utils import info.appdev.charting.utils.convertDpToPixel import timber.log.Timber @@ -315,18 +315,18 @@ abstract class PieRadarChartBase>> } /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. * Calculates the position around a center point, depending on the distance * from the center, and the angle of the position around the center. * @param angle in degrees, converted to radians internally */ - fun getPosition(center: MPPointF, dist: Float, angle: Float): MPPointF { + fun getPosition(center: PointF, dist: Float, angle: Float): PointF { val p = getInstance(0f, 0f) getPosition(center, dist, angle, p) return p } - fun getPosition(center: MPPointF, dist: Float, angle: Float, outputPoint: MPPointF) { + fun getPosition(center: PointF, dist: Float, angle: Float, outputPoint: PointF) { outputPoint.x = (center.x + dist * cos(Math.toRadians(angle.toDouble()))).toFloat() outputPoint.y = (center.y + dist * sin(Math.toRadians(angle.toDouble()))).toFloat() } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/Description.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/Description.kt index 8601ded2a..0eca946c0 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/Description.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/Description.kt @@ -1,7 +1,7 @@ package info.appdev.charting.components import android.graphics.Paint.Align -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.convertDpToPixel class Description : ComponentBase() { @@ -20,7 +20,7 @@ class Description : ComponentBase() { /** * the custom position of the description text */ - var position: MPPointF? = null + var position: PointF? = null private set /** @@ -44,7 +44,7 @@ class Description : ComponentBase() { */ fun setPosition(x: Float, y: Float) { if (this.position == null) { - this.position = MPPointF.getInstance(x, y) + this.position = PointF.getInstance(x, y) } else { position!!.x = x position!!.y = y diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/IMarker.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/IMarker.kt index b82d16aa4..61af265af 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/IMarker.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/IMarker.kt @@ -3,7 +3,7 @@ package info.appdev.charting.components import android.graphics.Canvas import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF interface IMarker { /** @@ -11,7 +11,7 @@ interface IMarker { * By returning x: -(width / 2) you will center the IMarker horizontally. * By returning y: -(height / 2) you will center the IMarker vertically. */ - val offset: MPPointF + val offset: PointF /** * @return The offset for drawing at the specific `point`. This allows conditional adjusting of the Marker position. @@ -22,7 +22,7 @@ interface IMarker { * @param posY This is the X position at which the marker wants to be drawn. * You can adjust the offset conditionally based on this argument. */ - fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): MPPointF? + fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): PointF? /** * This method enables a specified custom IMarker to update it's content every time the IMarker is redrawn. diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerImage.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerImage.kt index d2fb15d12..e0a67a832 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerImage.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerImage.kt @@ -8,7 +8,7 @@ import info.appdev.charting.charts.Chart import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight import info.appdev.charting.utils.FSize -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import java.lang.ref.WeakReference /** @@ -17,8 +17,8 @@ import java.lang.ref.WeakReference class MarkerImage(private var mContext: Context, drawableResourceId: Int) : IMarker { private var drawable: Drawable? = null - private var mOffset: MPPointF = MPPointF() - private val mOffset2 = MPPointF() + private var mOffset: PointF = PointF() + private val mOffset2 = PointF() private var mWeakChart: WeakReference?>? = null private var mSize: FSize? = FSize() @@ -39,7 +39,7 @@ class MarkerImage(private var mContext: Context, drawableResourceId: Int) : IMar mOffset.y = offsetY } - override var offset: MPPointF + override var offset: PointF get() = mOffset set(offset) { mOffset = offset @@ -61,7 +61,7 @@ class MarkerImage(private var mContext: Context, drawableResourceId: Int) : IMar mWeakChart = WeakReference?>(chart) } - override fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): MPPointF { + override fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): PointF { val offset = offset mOffset2.x = offset.x mOffset2.y = offset.y @@ -99,7 +99,7 @@ class MarkerImage(private var mContext: Context, drawableResourceId: Int) : IMar if (drawable == null) return - val offset: MPPointF = getOffsetForDrawingAtPoint(posX, posY) + val offset: PointF = getOffsetForDrawingAtPoint(posX, posY) var width = mSize!!.width var height = mSize!!.height diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerView.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerView.kt index 33bfe2913..4e85643f8 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerView.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/MarkerView.kt @@ -7,15 +7,15 @@ import android.widget.RelativeLayout import info.appdev.charting.charts.Chart import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import java.lang.ref.WeakReference /** * View that can be displayed when selecting values in the chart. Extend this class to provide custom layouts for your markers. */ open class MarkerView(context: Context?, layoutResource: Int) : RelativeLayout(context), IMarker { - private var mOffset: MPPointF = MPPointF() - private val mOffset2 = MPPointF() + private var mOffset: PointF = PointF() + private val mOffset2 = PointF() private var mWeakChart: WeakReference?>? = null /** @@ -43,7 +43,7 @@ open class MarkerView(context: Context?, layoutResource: Int) : RelativeLayout(c inflated.layout(0, 0, inflated.measuredWidth, inflated.measuredHeight) } - override var offset: MPPointF + override var offset: PointF get() = mOffset set(offset) { mOffset = offset @@ -55,7 +55,7 @@ open class MarkerView(context: Context?, layoutResource: Int) : RelativeLayout(c mWeakChart = WeakReference(chart) } - override fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): MPPointF { + override fun getOffsetForDrawingAtPoint(posX: Float, posY: Float): PointF { val offset = offset mOffset2.x = offset.x mOffset2.y = offset.y @@ -89,7 +89,7 @@ open class MarkerView(context: Context?, layoutResource: Int) : RelativeLayout(c } override fun draw(canvas: Canvas, posX: Float, posY: Float) { - val offset: MPPointF = getOffsetForDrawingAtPoint(posX, posY) + val offset: PointF = getOffsetForDrawingAtPoint(posX, posY) val saveId = canvas.save() // translate to the correct position and draw diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/BaseDataSet.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/BaseDataSet.kt index 33938d421..49f016c13 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/BaseDataSet.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/BaseDataSet.kt @@ -10,7 +10,7 @@ import info.appdev.charting.components.YAxis.AxisDependency import info.appdev.charting.formatter.IValueFormatter import info.appdev.charting.interfaces.datasets.IDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.convertDpToPixel @@ -76,7 +76,7 @@ abstract class BaseDataSet() : IDataSet { /** * the offset for drawing icons (in dp) */ - protected var mIconsOffset: MPPointF = MPPointF() + protected var mIconsOffset: PointF = PointF() /** * the size of the value-text labels @@ -151,7 +151,7 @@ abstract class BaseDataSet() : IDataSet { mIsDrawIcons = value } - override var iconsOffset: MPPointF + override var iconsOffset: PointF get() = mIconsOffset set(value) { mIconsOffset = value diff --git a/chartLib/src/main/kotlin/info/appdev/charting/highlight/BarHighlighter.kt b/chartLib/src/main/kotlin/info/appdev/charting/highlight/BarHighlighter.kt index 0e1946904..75459942e 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/highlight/BarHighlighter.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/highlight/BarHighlighter.kt @@ -2,7 +2,7 @@ package info.appdev.charting.highlight import info.appdev.charting.interfaces.dataprovider.BarDataProvider import info.appdev.charting.interfaces.datasets.IBarDataSet -import info.appdev.charting.utils.MPPointD +import info.appdev.charting.utils.PointD import kotlin.math.abs import kotlin.math.max @@ -24,7 +24,7 @@ open class BarHighlighter(barDataProvider: BarDataProvider) : ChartHighlighter(protecte override fun getHighlight(x: Float, y: Float): Highlight? { val pos = getValsForTouch(x, y) val xVal = pos.x.toFloat() - MPPointD.recycleInstance(pos) + PointD.recycleInstance(pos) val high = getHighlightForX(xVal, x, y) return high } /** - * Returns a recyclable MPPointD instance. + * Returns a recyclable PointD instance. * Returns the corresponding xPos for a given touch-position in pixels. */ - protected fun getValsForTouch(x: Float, y: Float): MPPointD { + protected fun getValsForTouch(x: Float, y: Float): PointD { // take any transformer to determine the x-axis value return provider.getTransformer(AxisDependency.LEFT)!!.getValuesByTouchPoint(x, y) diff --git a/chartLib/src/main/kotlin/info/appdev/charting/highlight/HorizontalBarHighlighter.kt b/chartLib/src/main/kotlin/info/appdev/charting/highlight/HorizontalBarHighlighter.kt index a3964febe..9ac9af962 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/highlight/HorizontalBarHighlighter.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/highlight/HorizontalBarHighlighter.kt @@ -4,7 +4,7 @@ import info.appdev.charting.data.DataSet import info.appdev.charting.data.Entry import info.appdev.charting.interfaces.dataprovider.BarDataProvider import info.appdev.charting.interfaces.datasets.IDataSet -import info.appdev.charting.utils.MPPointD +import info.appdev.charting.utils.PointD import kotlin.math.abs class HorizontalBarHighlighter(dataProvider: BarDataProvider) : BarHighlighter(dataProvider) { @@ -25,7 +25,7 @@ class HorizontalBarHighlighter(dataProvider: BarDataProvider) : BarHighlighter(d ) } - MPPointD.recycleInstance(pos) + PointD.recycleInstance(pos) return high } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/highlight/RadarHighlighter.kt b/chartLib/src/main/kotlin/info/appdev/charting/highlight/RadarHighlighter.kt index 6fff24ffa..52a39323f 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/highlight/RadarHighlighter.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/highlight/RadarHighlighter.kt @@ -2,7 +2,7 @@ package info.appdev.charting.highlight import info.appdev.charting.charts.RadarChart import info.appdev.charting.data.Entry -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import kotlin.math.abs @@ -42,7 +42,7 @@ open class RadarHighlighter(chart: RadarChart) : PieRadarHighlighter val sliceAngle = chartPieRadar.sliceAngle val factor = chartPieRadar.factor - val pOut = MPPointF.getInstance(0f, 0f) + val pOut = PointF.getInstance(0f, 0f) for (i in 0.. { /** @@ -286,7 +286,7 @@ interface IDataSet { * For all charts except Pie and Radar it will be ordinary (x offset,y offset). * For Pie and Radar chart it will be (y offset, distance from center offset); so if you want icon to be rendered under value, you should increase X component of CGPoint, and if you want icon to be rendered closet to center, you should decrease height component of CGPoint. */ - var iconsOffset: MPPointF + var iconsOffset: PointF /** * Set the visibility of this DataSet. If not visible, the DataSet will not diff --git a/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt b/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt index 927a658cd..c8879437c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt @@ -12,7 +12,7 @@ import info.appdev.charting.data.BarLineScatterCandleBubbleData import info.appdev.charting.data.Entry import info.appdev.charting.interfaces.datasets.IBarLineScatterCandleBubbleDataSet import info.appdev.charting.interfaces.datasets.IDataSet -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.convertDpToPixel import timber.log.Timber @@ -44,12 +44,12 @@ class BarLineChartTouchListener( /** * point where the touch action started */ - private val touchStartPoint: MPPointF = MPPointF.getInstance(0f, 0f) + private val touchStartPoint: PointF = PointF.getInstance(0f, 0f) /** * center between two pointers (fingers on the display) */ - private val touchPointCenter: MPPointF = MPPointF.getInstance(0f, 0f) + private val touchPointCenter: PointF = PointF.getInstance(0f, 0f) private var savedXDist = 1f private var savedYDist = 1f @@ -63,8 +63,8 @@ class BarLineChartTouchListener( private var velocityTracker: VelocityTracker? = null private var decelerationLastTime: Long = 0 - private val decelerationCurrentPoint: MPPointF = MPPointF.getInstance(0f, 0f) - private val decelerationVelocity: MPPointF = MPPointF.getInstance(0f, 0f) + private val decelerationCurrentPoint: PointF = PointF.getInstance(0f, 0f) + private val decelerationVelocity: PointF = PointF.getInstance(0f, 0f) /** * the distance of movement that will be counted as a drag @@ -380,7 +380,7 @@ class BarLineChartTouchListener( } } - MPPointF.recycleInstance(t) + PointF.recycleInstance(t) } } } @@ -388,7 +388,7 @@ class BarLineChartTouchListener( /** * limit scaleX range */ - private fun getLimitedScaleX(scaleX: Float, t: MPPointF): Float { + private fun getLimitedScaleX(scaleX: Float, t: PointF): Float { val h = chart.viewPortHandler tempMatrix.set(savedMatrix) tempMatrix.postScale(scaleX, 1f, t.x, t.y) @@ -412,7 +412,7 @@ class BarLineChartTouchListener( /** * limit scaleY range */ - private fun getLimitedScaleY(scaleY: Float, t: MPPointF): Float { + private fun getLimitedScaleY(scaleY: Float, t: PointF): Float { val h = chart.viewPortHandler tempMatrix.set(savedMatrix) tempMatrix.postScale(1f, scaleY, t.x, t.y) @@ -449,11 +449,11 @@ class BarLineChartTouchListener( /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. * returns the correct translation depending on the provided x and y touch * points */ - fun getTrans(x: Float, y: Float): MPPointF { + fun getTrans(x: Float, y: Float): PointF { val vph = chart.viewPortHandler val xTrans = x - vph.offsetLeft() @@ -465,7 +465,7 @@ class BarLineChartTouchListener( -(chart.measuredHeight - y - vph.offsetBottom()) } - return MPPointF.getInstance(xTrans, yTrans) + return PointF.getInstance(xTrans, yTrans) } /** @@ -507,7 +507,7 @@ class BarLineChartTouchListener( onChartGestureListener?.onChartScale(e, scaleX, scaleY) - MPPointF.recycleInstance(trans) + PointF.recycleInstance(trans) } return super.onDoubleTap(e) @@ -610,7 +610,7 @@ class BarLineChartTouchListener( * @param point * @param event */ - private fun midPoint(point: MPPointF, event: MotionEvent) { + private fun midPoint(point: PointF, event: MotionEvent) { val x = event.getX(0) + event.getX(1) val y = event.getY(0) + event.getY(1) point.x = (x / 2f) diff --git a/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt b/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt index eeeef61fb..498398a04 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt @@ -5,12 +5,12 @@ import android.view.MotionEvent import android.view.View import android.view.animation.AnimationUtils import info.appdev.charting.charts.PieRadarChartBase -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.convertDpToPixel import kotlin.math.abs class PieRadarChartTouchListener(chart: PieRadarChartBase<*>) : ChartTouchListener>(chart) { - private val touchStartPoint: MPPointF = MPPointF.getInstance(0f, 0f) + private val touchStartPoint: PointF = PointF.getInstance(0f, 0f) /** * the angle where the dragging started diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/AxisRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/AxisRenderer.kt index 1f331ce7d..ad97d2020 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/AxisRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/AxisRenderer.kt @@ -4,7 +4,7 @@ import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint import info.appdev.charting.components.AxisBase -import info.appdev.charting.utils.MPPointD +import info.appdev.charting.utils.PointD import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.roundToNextSignificant @@ -104,8 +104,8 @@ abstract class AxisRenderer( maxLocal = p2.y.toFloat() } - MPPointD.recycleInstance(p1) - MPPointD.recycleInstance(p2) + PointD.recycleInstance(p1) + PointD.recycleInstance(p2) } } computeAxisValues(minLocal, maxLocal) diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/BarChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/BarChartRenderer.kt index 6c0643695..df9e65ea9 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/BarChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/BarChartRenderer.kt @@ -10,7 +10,7 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.dataprovider.BarDataProvider import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.utils.Fill -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -293,7 +293,7 @@ open class BarChartRenderer( val phaseY = animator.phaseY - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -493,7 +493,7 @@ open class BarChartRenderer( } } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/BubbleChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/BubbleChartRenderer.kt index 65f5ac734..dcabae948 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/BubbleChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/BubbleChartRenderer.kt @@ -7,7 +7,7 @@ import info.appdev.charting.animation.ChartAnimator import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.dataprovider.BubbleDataProvider import info.appdev.charting.interfaces.datasets.IBubbleDataSet -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.calcTextHeight @@ -127,7 +127,7 @@ open class BubbleChartRenderer( else phaseX - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -174,7 +174,7 @@ open class BubbleChartRenderer( j += 2 } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/CandleStickChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/CandleStickChartRenderer.kt index de02bb5a0..995fc7d3c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/CandleStickChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/CandleStickChartRenderer.kt @@ -7,7 +7,7 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.dataprovider.CandleDataProvider import info.appdev.charting.interfaces.datasets.ICandleDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.convertDpToPixel @@ -234,7 +234,7 @@ open class CandleStickChartRenderer( val yOffset = 5f.convertDpToPixel() - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -280,7 +280,7 @@ open class CandleStickChartRenderer( j += 2 } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/HorizontalBarChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/HorizontalBarChartRenderer.kt index d18ebca1a..9d78815e0 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/HorizontalBarChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/HorizontalBarChartRenderer.kt @@ -10,7 +10,7 @@ import info.appdev.charting.interfaces.dataprovider.BarDataProvider import info.appdev.charting.interfaces.dataprovider.base.IBaseProvider import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.utils.Fill -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -197,7 +197,7 @@ open class HorizontalBarChartRenderer( val phaseY = animator.phaseY - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -435,7 +435,7 @@ open class HorizontalBarChartRenderer( } } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/LineChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/LineChartRenderer.kt index f8750bd70..f50e592d7 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/LineChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/LineChartRenderer.kt @@ -14,7 +14,7 @@ import info.appdev.charting.interfaces.dataprovider.LineDataProvider import info.appdev.charting.interfaces.datasets.IDataSet import info.appdev.charting.interfaces.datasets.ILineDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -512,7 +512,7 @@ open class LineChartRenderer( .phaseY, xBounds.min, xBounds.max ) - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -554,7 +554,7 @@ open class LineChartRenderer( j += 2 } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/PieChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/PieChartRenderer.kt index 412d8448c..2801f8d77 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/PieChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/PieChartRenderer.kt @@ -18,7 +18,7 @@ import info.appdev.charting.data.PieDataSet.ValuePosition import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IPieDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.calcTextHeight @@ -113,7 +113,7 @@ open class PieChartRenderer( private val mInnerRectBuffer = RectF() protected fun calculateMinimumRadiusForSpacedSlice( - center: MPPointF, + center: PointF, radius: Float, angle: Float, arcStartPointX: Float, @@ -346,7 +346,7 @@ open class PieChartRenderer( angle += sliceAngle * phaseX } - MPPointF.recycleInstance(center) + PointF.recycleInstance(center) } override fun drawValues(canvas: Canvas) { @@ -420,7 +420,7 @@ open class PieChartRenderer( val sliceSpace = getSliceSpace(dataSet) - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -580,10 +580,10 @@ open class PieChartRenderer( xIndex++ } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } - MPPointF.recycleInstance(center) + PointF.recycleInstance(center) } } @@ -632,7 +632,7 @@ open class PieChartRenderer( // reset alpha paintTransparentCircle.alpha = alpha } - MPPointF.recycleInstance(center) + PointF.recycleInstance(center) } } @@ -698,8 +698,8 @@ open class PieChartRenderer( canvas.restore() - MPPointF.recycleInstance(center) - MPPointF.recycleInstance(offset) + PointF.recycleInstance(center) + PointF.recycleInstance(offset) } } @@ -900,7 +900,7 @@ open class PieChartRenderer( bitmapCanvas!!.drawPath(mPathBuffer, paintRender) } - MPPointF.recycleInstance(center) + PointF.recycleInstance(center) } /** @@ -946,7 +946,7 @@ open class PieChartRenderer( } angle += sliceAngle * phaseX } - MPPointF.recycleInstance(center) + PointF.recycleInstance(center) } /** diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt index 7d4528273..452675fd3 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt @@ -10,7 +10,7 @@ import info.appdev.charting.charts.RadarChart import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IRadarDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.convertDpToPixel @@ -61,7 +61,7 @@ open class RadarChartRenderer( val factor = chart.factor val center = chart.centerOffsets - val pOut = MPPointF.getInstance(0f, 0f) + val pOut = PointF.getInstance(0f, 0f) val surface = drawDataSetSurfacePathBuffer surface.reset() @@ -109,8 +109,8 @@ open class RadarChartRenderer( // draw the line (only if filled is disabled or alpha is below 255) if (!dataSet.isDrawFilledEnabled || dataSet.fillAlpha < 255) canvas.drawPath(surface, paintRender) - MPPointF.recycleInstance(center) - MPPointF.recycleInstance(pOut) + PointF.recycleInstance(center) + PointF.recycleInstance(pOut) } override fun drawValues(canvas: Canvas) { @@ -124,8 +124,8 @@ open class RadarChartRenderer( val factor = chart.factor val center = chart.centerOffsets - val pOut = MPPointF.getInstance(0f, 0f) - val pIcon = MPPointF.getInstance(0f, 0f) + val pOut = PointF.getInstance(0f, 0f) + val pIcon = PointF.getInstance(0f, 0f) val yOffset = 5f.convertDpToPixel() @@ -143,7 +143,7 @@ open class RadarChartRenderer( // apply the text-styling defined by the DataSet applyValueTextStyle(dataSet) - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -194,13 +194,13 @@ open class RadarChartRenderer( } } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } - MPPointF.recycleInstance(center) - MPPointF.recycleInstance(pOut) - MPPointF.recycleInstance(pIcon) + PointF.recycleInstance(center) + PointF.recycleInstance(pOut) + PointF.recycleInstance(pIcon) } override fun drawExtras(canvas: Canvas) { @@ -225,7 +225,7 @@ open class RadarChartRenderer( val xIncrements = 1 + chart.skipWebLineCount val maxEntryCount = chart.getData()!!.maxEntryCountSet?.entryCount ?: 0 - val p = MPPointF.getInstance(0f, 0f) + val p = PointF.getInstance(0f, 0f) var i = 0 while (i < maxEntryCount) { Utils.getPosition( @@ -238,7 +238,7 @@ open class RadarChartRenderer( canvas.drawLine(center.x, center.y, p.x, p.y, webPaint) i += xIncrements } - MPPointF.recycleInstance(p) + PointF.recycleInstance(p) // draw the inner-web webPaint.strokeWidth = chart.webLineWidthInner @@ -247,8 +247,8 @@ open class RadarChartRenderer( val labelCount = chart.yAxis.entryCount - val p1out = MPPointF.getInstance(0f, 0f) - val p2out = MPPointF.getInstance(0f, 0f) + val p1out = PointF.getInstance(0f, 0f) + val p2out = PointF.getInstance(0f, 0f) for (j in 0..) { @@ -295,7 +295,7 @@ open class RadarChartRenderer( val factor = chart.factor val center = chart.centerOffsets - val pOut = MPPointF.getInstance(0f, 0f) + val pOut = PointF.getInstance(0f, 0f) val radarData = chart.getData() @@ -348,8 +348,8 @@ open class RadarChartRenderer( } } - MPPointF.recycleInstance(center) - MPPointF.recycleInstance(pOut) + PointF.recycleInstance(center) + PointF.recycleInstance(pOut) } protected var mDrawHighlightCirclePathBuffer: Path = Path() @@ -372,7 +372,7 @@ open class RadarChartRenderer( fun drawHighlightCircle( canvas: Canvas, - point: MPPointF, + point: PointF, innerRadius: Float, outerRadius: Float, fillColor: Int, diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/ScatterChartRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/ScatterChartRenderer.kt index 37e754ef0..7abd0ac74 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/ScatterChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/ScatterChartRenderer.kt @@ -5,7 +5,7 @@ import info.appdev.charting.animation.ChartAnimator import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.dataprovider.ScatterDataProvider import info.appdev.charting.interfaces.datasets.IScatterDataSet -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.convertDpToPixel @@ -100,7 +100,7 @@ open class ScatterChartRenderer(@JvmField var dataProvider: ScatterDataProvider, val shapeSize = dataSet.scatterShapeSize.convertDpToPixel() - val iconsOffset = MPPointF.getInstance(dataSet.iconsOffset) + val iconsOffset = PointF.getInstance(dataSet.iconsOffset) iconsOffset.x = iconsOffset.x.convertDpToPixel() iconsOffset.y = iconsOffset.y.convertDpToPixel() @@ -148,7 +148,7 @@ open class ScatterChartRenderer(@JvmField var dataProvider: ScatterDataProvider, j += 2 } - MPPointF.recycleInstance(iconsOffset) + PointF.recycleInstance(iconsOffset) } } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRenderer.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRenderer.kt index 16db12229..959f4fad8 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRenderer.kt @@ -13,8 +13,8 @@ import info.appdev.charting.components.LimitLine.LimitLabelPosition import info.appdev.charting.components.XAxis import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.utils.FSize -import info.appdev.charting.utils.MPPointD -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointD +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -54,8 +54,8 @@ open class XAxisRenderer( maxLocal = p2.x.toFloat() } - MPPointD.recycleInstance(p1) - MPPointD.recycleInstance(p2) + PointD.recycleInstance(p1) + PointD.recycleInstance(p2) } computeAxisValues(minLocal, maxLocal) @@ -99,7 +99,7 @@ open class XAxisRenderer( paintAxisLabels.color = xAxis.textColor - val pointF = MPPointF.getInstance(0f, 0f) + val pointF = PointF.getInstance(0f, 0f) when (xAxis.position) { XAxisPosition.TOP -> { pointF.x = 0.5f @@ -134,7 +134,7 @@ open class XAxisRenderer( drawLabels(canvas, viewPortHandler.contentBottom() + yOffset, pointF) } } - MPPointF.recycleInstance(pointF) + PointF.recycleInstance(pointF) } override fun renderAxisLine(canvas: Canvas) { @@ -167,7 +167,7 @@ open class XAxisRenderer( * * @param pos */ - protected open fun drawLabels(canvas: Canvas, pos: Float, anchor: MPPointF) { + protected open fun drawLabels(canvas: Canvas, pos: Float, anchor: PointF) { val labelRotationAngleDegrees = xAxis.labelRotationAngle val centeringEnabled = xAxis.isCenterAxisLabelsEnabled @@ -229,7 +229,7 @@ open class XAxisRenderer( } } - protected fun drawLabel(canvas: Canvas, formattedLabel: String?, x: Float, y: Float, anchor: MPPointF, angleDegrees: Float) { + protected fun drawLabel(canvas: Canvas, formattedLabel: String?, x: Float, y: Float, anchor: PointF, angleDegrees: Float) { formattedLabel?.let { canvas.drawXAxisValue(it, x, y, paintAxisLabels, anchor, angleDegrees) } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererHorizontalBarChart.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererHorizontalBarChart.kt index e4884e42b..71c5884bc 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererHorizontalBarChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererHorizontalBarChart.kt @@ -10,8 +10,8 @@ import info.appdev.charting.components.LimitLine.LimitLabelPosition import info.appdev.charting.components.XAxis import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.utils.FSize -import info.appdev.charting.utils.MPPointD -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointD +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Transformer import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -46,8 +46,8 @@ open class XAxisRendererHorizontalBarChart( maxLocal = p2.y.toFloat() } - MPPointD.recycleInstance(p1) - MPPointD.recycleInstance(p2) + PointD.recycleInstance(p1) + PointD.recycleInstance(p2) } computeAxisValues(minLocal, maxLocal) @@ -86,7 +86,7 @@ open class XAxisRendererHorizontalBarChart( paintAxisLabels.textSize = xAxis.textSize paintAxisLabels.color = xAxis.textColor - val pointF = MPPointF.getInstance(0f, 0f) + val pointF = PointF.getInstance(0f, 0f) when (xAxis.position) { XAxisPosition.TOP -> { @@ -123,10 +123,10 @@ open class XAxisRendererHorizontalBarChart( } } - MPPointF.recycleInstance(pointF) + PointF.recycleInstance(pointF) } - override fun drawLabels(canvas: Canvas, pos: Float, anchor: MPPointF) { + override fun drawLabels(canvas: Canvas, pos: Float, anchor: PointF) { val labelRotationAngleDegrees = xAxis.labelRotationAngle val centeringEnabled = xAxis.isCenterAxisLabelsEnabled diff --git a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererRadarChart.kt b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererRadarChart.kt index f878905bd..01cdbd868 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererRadarChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/XAxisRendererRadarChart.kt @@ -3,7 +3,7 @@ package info.appdev.charting.renderer import android.graphics.Canvas import info.appdev.charting.charts.RadarChart import info.appdev.charting.components.XAxis -import info.appdev.charting.utils.MPPointF +import info.appdev.charting.utils.PointF import info.appdev.charting.utils.Utils import info.appdev.charting.utils.ViewPortHandler @@ -13,7 +13,7 @@ class XAxisRendererRadarChart(viewPortHandler: ViewPortHandler, xAxis: XAxis, pr return val labelRotationAngleDegrees = xAxis.labelRotationAngle - val drawLabelAnchor = MPPointF.getInstance(0.5f, 0.25f) + val drawLabelAnchor = PointF.getInstance(0.5f, 0.25f) paintAxisLabels.typeface = xAxis.typeface paintAxisLabels.textSize = xAxis.textSize @@ -26,7 +26,7 @@ class XAxisRendererRadarChart(viewPortHandler: ViewPortHandler, xAxis: XAxis, pr val factor = chart.factor val center = chart.centerOffsets - val pOut = MPPointF.getInstance(0f, 0f) + val pOut = PointF.getInstance(0f, 0f) chart.getData()!!.maxEntryCountSet?.let { maxEntryCountSet -> for (i in 0..() { - override fun instantiate(): MPPointD { - return MPPointD(0.0, 0.0) +class PointD private constructor(var x: Double, var y: Double) : Poolable() { + override fun instantiate(): PointD { + return PointD(0.0, 0.0) } /** * returns a string representation of the object */ override fun toString(): String { - return "MPPointD, x: $x, y: $y" + return "PointD, x: $x, y: $y" } companion object { - private val pool: ObjectPool = ObjectPool.create(64, MPPointD(0.0, 0.0)) + private val pool: ObjectPool = ObjectPool.create(64, PointD(0.0, 0.0)) init { pool.replenishPercentage = 0.5f } - fun getInstance(x: Double, y: Double): MPPointD { - val result: MPPointD = pool.get() + fun getInstance(x: Double, y: Double): PointD { + val result: PointD = pool.get() result.x = x result.y = y return result } - fun recycleInstance(instance: MPPointD) { + fun recycleInstance(instance: PointD) { pool.recycle(instance) } - fun recycleInstances(instances: MutableList) { + fun recycleInstances(instances: MutableList) { pool.recycle(instances) } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/MPPointF.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/PointF.kt similarity index 65% rename from chartLib/src/main/kotlin/info/appdev/charting/utils/MPPointF.kt rename to chartLib/src/main/kotlin/info/appdev/charting/utils/PointF.kt index bef01b235..b63c0443d 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/MPPointF.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/PointF.kt @@ -4,7 +4,7 @@ import android.os.Parcel import android.os.Parcelable import info.appdev.charting.utils.ObjectPool.Poolable -class MPPointF : Poolable { +class PointF : Poolable { var x: Float = 0f var y: Float = 0f @@ -27,8 +27,8 @@ class MPPointF : Poolable { y = `in`.readFloat() } - override fun instantiate(): MPPointF { - return MPPointF(0f, 0f) + override fun instantiate(): PointF { + return PointF(0f, 0f) } override fun toString(): String { @@ -36,44 +36,44 @@ class MPPointF : Poolable { } companion object { - private var pool: ObjectPool = ObjectPool.create(32, MPPointF(0f, 0f)) + private var pool: ObjectPool = ObjectPool.create(32, PointF(0f, 0f)) init { pool.replenishPercentage = 0.5f } - fun getInstance(x: Float, y: Float): MPPointF { - val result: MPPointF = pool.get() + fun getInstance(x: Float, y: Float): PointF { + val result: PointF = pool.get() result.x = x result.y = y return result } - val instance: MPPointF + val instance: PointF get() = pool.get() - fun getInstance(copy: MPPointF): MPPointF { - val result: MPPointF = pool.get() + fun getInstance(copy: PointF): PointF { + val result: PointF = pool.get() result.x = copy.x result.y = copy.y return result } @JvmStatic - fun recycleInstance(instance: MPPointF?) { + fun recycleInstance(instance: PointF?) { pool.recycle(instance) } - fun recycleInstances(instances: MutableList) { + fun recycleInstances(instances: MutableList) { pool.recycle(instances) } - val CREATOR: Parcelable.Creator = object : Parcelable.Creator { + val CREATOR: Parcelable.Creator = object : Parcelable.Creator { /** * Return a new point from the data in the specified parcel. */ - override fun createFromParcel(`in`: Parcel): MPPointF { - val r = MPPointF(0f, 0f) + override fun createFromParcel(`in`: Parcel): PointF { + val r = PointF(0f, 0f) r.my_readFromParcel(`in`) return r } @@ -81,7 +81,7 @@ class MPPointF : Poolable { /** * Return an array of rectangles of the specified size. */ - override fun newArray(size: Int): Array { + override fun newArray(size: Int): Array { return arrayOfNulls(size) } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt index d913e50aa..2440a7a1e 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt @@ -8,7 +8,7 @@ import info.appdev.charting.interfaces.datasets.IBubbleDataSet import info.appdev.charting.interfaces.datasets.ICandleDataSet import info.appdev.charting.interfaces.datasets.ILineDataSet import info.appdev.charting.interfaces.datasets.IScatterDataSet -import info.appdev.charting.utils.MPPointD.Companion.getInstance +import info.appdev.charting.utils.PointD.Companion.getInstance import kotlin.Boolean import kotlin.FloatArray import kotlin.Int @@ -334,19 +334,19 @@ open class Transformer(@JvmField protected var viewPortHandler: ViewPortHandler) var ptsBuffer: FloatArray = FloatArray(2) /** - * Returns a recyclable MPPointD instance. + * Returns a recyclable PointD instance. * returns the x and y values in the chart at the given touch point - * (encapsulated in a MPPointD). This method transforms pixel coordinates to + * (encapsulated in a PointD). This method transforms pixel coordinates to * coordinates / values in the chart. This is the opposite method to * getPixelForValues(...). */ - fun getValuesByTouchPoint(x: Float, y: Float): MPPointD { + fun getValuesByTouchPoint(x: Float, y: Float): PointD { val result = getInstance(0.0, 0.0) getValuesByTouchPoint(x, y, result) return result } - fun getValuesByTouchPoint(x: Float, y: Float, outputPoint: MPPointD) { + fun getValuesByTouchPoint(x: Float, y: Float, outputPoint: PointD) { ptsBuffer[0] = x ptsBuffer[1] = y @@ -357,10 +357,10 @@ open class Transformer(@JvmField protected var viewPortHandler: ViewPortHandler) } /** - * Returns a recyclable MPPointD instance. + * Returns a recyclable PointD instance. * Returns the x and y coordinates (pixels) for a given x and y value in the chart. */ - fun getPixelForValues(x: Float, y: Float): MPPointD { + fun getPixelForValues(x: Float, y: Float): PointD { ptsBuffer[0] = x ptsBuffer[1] = y diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt index 10b639d29..0bdb44399 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt @@ -9,7 +9,7 @@ import android.view.VelocityTracker import android.view.ViewConfiguration import info.appdev.charting.formatter.DefaultValueFormatter import info.appdev.charting.formatter.IValueFormatter -import info.appdev.charting.utils.MPPointF.Companion.instance +import info.appdev.charting.utils.PointF.Companion.instance import kotlin.Int import kotlin.IntArray import kotlin.Suppress @@ -57,7 +57,7 @@ object Utils { } /** - * Returns a recyclable MPPointF instance. + * Returns a recyclable PointF instance. * Calculates the position around a center point, depending on the distance * from the center, and the angle of the position around the center. * @@ -66,13 +66,13 @@ object Utils { * @param angle in degrees, converted to radians internally * @return */ - fun getPosition(center: MPPointF, dist: Float, angle: Float): MPPointF { - val p = MPPointF.getInstance(0f, 0f) + fun getPosition(center: PointF, dist: Float, angle: Float): PointF { + val p = PointF.getInstance(0f, 0f) getPosition(center, dist, angle, p) return p } - fun getPosition(center: MPPointF, dist: Float, angle: Float, outputPoint: MPPointF) { + fun getPosition(center: PointF, dist: Float, angle: Float, outputPoint: PointF) { outputPoint.x = (center.x + dist * cos(Math.toRadians(angle.toDouble()))).toFloat() outputPoint.y = (center.y + dist * sin(Math.toRadians(angle.toDouble()))).toFloat() } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/ViewPortHandler.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/ViewPortHandler.kt index edc7773db..bc6c2b60c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/ViewPortHandler.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/ViewPortHandler.kt @@ -131,8 +131,8 @@ open class ViewPortHandler { fun contentHeight(): Float = contentRect.height() - val contentCenter: MPPointF - get() = MPPointF.getInstance(contentRect.centerX(), contentRect.centerY()) + val contentCenter: PointF + get() = PointF.getInstance(contentRect.centerX(), contentRect.centerY()) /** * Returns the smallest extension of the content rect (width or height).