diff --git a/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt index 8046b5491..ef11617bb 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt @@ -55,7 +55,7 @@ class HalfPieChartActivity : DemoBase() { binding.chart1.isDrawCenterText = true binding.chart1.isRotationEnabled = false - binding.chart1.isHighlightPerTapEnabled = true + binding.chart1.isHighlightPerTap = true binding.chart1.maxAngle = 180f // HALF CHART binding.chart1.rotationAngle = 180f diff --git a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt index 14d01b830..6fd38ad15 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt @@ -40,7 +40,7 @@ class HorizontalBarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartV binding.seekBarX.setOnSeekBarChangeListener(this) binding.chart1.setOnChartValueSelectedListener(this) - binding.chart1.isLogEnabled = true + binding.chart1.isLogging = true // chart.setHighlightEnabled(false); binding.chart1.isDrawBarShadow = false diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt index 7ef544c0d..79ce3a361 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt @@ -68,7 +68,7 @@ class PieChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect binding.chart1.rotationAngle = 0f // enable rotation of the chart by touch binding.chart1.isRotationEnabled = true - binding.chart1.isHighlightPerTapEnabled = true + binding.chart1.isHighlightPerTap = true // chart.setUnit(" €"); // chart.setDrawUnitsInChart(true); diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt index 8c065edde..db9de95ef 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt @@ -69,7 +69,7 @@ class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValu binding.chart1.rotationAngle = 0f // enable rotation of the chart by touch binding.chart1.isRotationEnabled = true - binding.chart1.isHighlightPerTapEnabled = true + binding.chart1.isHighlightPerTap = true // chart.setUnit(" €"); // chart.setDrawUnitsInChart(true); diff --git a/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt index 4a422ffac..f3cf3b781 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt @@ -71,7 +71,7 @@ class PiePolylineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartVal binding.chart1.rotationAngle = 0f // enable rotation of the chart by touch binding.chart1.isRotationEnabled = true - binding.chart1.isHighlightPerTapEnabled = true + binding.chart1.isHighlightPerTap = true // chart.setUnit(" €"); // chart.setDrawUnitsInChart(true); 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 a6d4123cc..35dd5ead8 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt @@ -335,7 +335,7 @@ abstract class BarLineChartBase>> : ViewGroup, IBaseP /** * Returns true if log-output is enabled for the chart, fals if not. */ - var isLogEnabled: Boolean = false + var isLogging = false /** * object that holds all data that was originally set for the chart, before @@ -65,12 +65,12 @@ abstract class Chart>> : ViewGroup, IBaseP * Set this to false to prevent values from being highlighted by tap gesture. * Values can still be highlighted via drag or programmatically. Default: true */ - var isHighlightPerTapEnabled: Boolean = true + var isHighlightPerTap = true /** * If set to true, chart continues to scroll after touch up */ - var isDragDecelerationEnabled: Boolean = true + var isDragDeceleration = true /** * Deceleration friction coefficient in [0 ; 1] interval, higher values @@ -221,7 +221,7 @@ abstract class Chart>> : ViewGroup, IBaseP mInfoPaint.textAlign = Align.CENTER mInfoPaint.textSize = 12f.convertDpToPixel() - if (this.isLogEnabled) { + if (this.isLogging) { Timber.i("Chart.init()") // enable being detected by ScreenReader @@ -535,7 +535,7 @@ abstract class Chart>> : ViewGroup, IBaseP if (high == null) { this.highlighted = null } else { - if (this.isLogEnabled) { + if (this.isLogging) { Timber.i("Highlighted: $high") } @@ -1051,7 +1051,7 @@ abstract class Chart>> : ViewGroup, IBaseP // let the chart know there is new data notifyDataSetChanged() - if (isLogEnabled) { + if (isLogging) { Timber.i("Data is set.") } } @@ -1203,17 +1203,17 @@ abstract class Chart>> : ViewGroup, IBaseP } override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { - if (this.isLogEnabled) { + if (this.isLogging) { Timber.i("OnSizeChanged()") } if (w > 0 && h > 0 && w < 10000 && h < 10000) { - if (this.isLogEnabled) { + if (this.isLogging) { Timber.i("Setting chart dimens, width: $w, height: $h") } viewPortHandler.setChartDimens(w.toFloat(), h.toFloat()) } else { - if (this.isLogEnabled) { + if (this.isLogging) { Timber.w("*Avoiding* setting chart dimens! width: $w, height: $h") } } 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 227b9871f..23e07f461 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt @@ -182,7 +182,7 @@ open class HorizontalBarChart : BarChart { max(minOffset, offsetBottom) ) - if (isLogEnabled) { + if (isLogging) { Timber.i("offsetLeft: $offsetLeft, offsetTop: $offsetTop, offsetRight: $offsetRight, offsetBottom: $offsetBottom") Timber.i("Content: ${viewPortHandler.contentRect}") } @@ -251,7 +251,7 @@ open class HorizontalBarChart : BarChart { */ override fun getHighlightByTouchPoint(x: Float, y: Float): Highlight? { if (mData == null) { - if (isLogEnabled) { + if (isLogging) { Timber.e("Can't select by touch. No data set.") } return null 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 ff91213d6..0ba8785fd 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt @@ -279,7 +279,7 @@ abstract class PieRadarChartBase>> viewPortHandler.restrainViewPort(offsetLeft, offsetTop, offsetRight, offsetBottom) - if (isLogEnabled) + if (isLogging) Timber.i("offsetLeft: $offsetLeft, offsetTop: $offsetTop, offsetRight: $offsetRight, offsetBottom: $offsetBottom") } 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 8e79896f9..01b2e0420 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt @@ -211,7 +211,7 @@ class BarLineChartTouchListener( if (abs(velocityX.toDouble()) > Utils.minimumFlingVelocity || abs(velocityY.toDouble()) > Utils.minimumFlingVelocity ) { - if (touchMode == DRAG && chart.isDragDecelerationEnabled) { + if (touchMode == DRAG && chart.isDragDeceleration) { stopDeceleration() decelerationLastTime = AnimationUtils.currentAnimationTimeMillis() @@ -502,7 +502,7 @@ class BarLineChartTouchListener( chart.zoom(scaleX, scaleY, trans.x, trans.y) - if (chart.isLogEnabled) + if (chart.isLogging) Timber.i("Double-Tap, Zooming In, x: ${trans.x} y: ${trans.y}") onChartGestureListener?.onChartScale(e, scaleX, scaleY) @@ -528,7 +528,7 @@ class BarLineChartTouchListener( l?.onChartSingleTapped(e) - if (!chart.isHighlightPerTapEnabled) { + if (!chart.isHighlightPerTap) { return false } 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 d0906dd10..20db46091 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/listener/PieRadarChartTouchListener.kt @@ -42,7 +42,7 @@ class PieRadarChartTouchListener(chart: PieRadarChartBase<*>) : ChartTouchListen resetVelocity() - if (chart.isDragDecelerationEnabled) { + if (chart.isDragDeceleration) { sampleVelocity(x, y) } @@ -52,7 +52,7 @@ class PieRadarChartTouchListener(chart: PieRadarChartBase<*>) : ChartTouchListen } MotionEvent.ACTION_MOVE -> { - if (chart.isDragDecelerationEnabled) { + if (chart.isDragDeceleration) { sampleVelocity(x, y) } @@ -72,7 +72,7 @@ class PieRadarChartTouchListener(chart: PieRadarChartBase<*>) : ChartTouchListen } MotionEvent.ACTION_UP -> { - if (chart.isDragDecelerationEnabled) { + if (chart.isDragDeceleration) { stopDeceleration() sampleVelocity(x, y) @@ -114,7 +114,7 @@ class PieRadarChartTouchListener(chart: PieRadarChartBase<*>) : ChartTouchListen onChartGestureListener?.onChartSingleTapped(e) - if (!chart.isHighlightPerTapEnabled) { + if (!chart.isHighlightPerTap) { return false }