Skip to content

Commit 8344cda

Browse files
authored
Merge pull request #657 from AppDevNext/RenamePropertyWithNoEnabled
Methods with 'enabled' as properties
2 parents 624502b + 2d03384 commit 8344cda

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class HalfPieChartActivity : DemoBase() {
5555
binding.chart1.isDrawCenterText = true
5656

5757
binding.chart1.isRotationEnabled = false
58-
binding.chart1.isHighlightPerTapEnabled = true
58+
binding.chart1.isHighlightPerTap = true
5959

6060
binding.chart1.maxAngle = 180f // HALF CHART
6161
binding.chart1.rotationAngle = 180f

app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class HorizontalBarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartV
4040
binding.seekBarX.setOnSeekBarChangeListener(this)
4141

4242
binding.chart1.setOnChartValueSelectedListener(this)
43-
binding.chart1.isLogEnabled = true
43+
binding.chart1.isLogging = true
4444

4545
// chart.setHighlightEnabled(false);
4646
binding.chart1.isDrawBarShadow = false

app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PieChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
6868
binding.chart1.rotationAngle = 0f
6969
// enable rotation of the chart by touch
7070
binding.chart1.isRotationEnabled = true
71-
binding.chart1.isHighlightPerTapEnabled = true
71+
binding.chart1.isHighlightPerTap = true
7272

7373
// chart.setUnit(" €");
7474
// chart.setDrawUnitsInChart(true);

app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValu
6969
binding.chart1.rotationAngle = 0f
7070
// enable rotation of the chart by touch
7171
binding.chart1.isRotationEnabled = true
72-
binding.chart1.isHighlightPerTapEnabled = true
72+
binding.chart1.isHighlightPerTap = true
7373

7474
// chart.setUnit(" €");
7575
// chart.setDrawUnitsInChart(true);

app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class PiePolylineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartVal
7171
binding.chart1.rotationAngle = 0f
7272
// enable rotation of the chart by touch
7373
binding.chart1.isRotationEnabled = true
74-
binding.chart1.isHighlightPerTapEnabled = true
74+
binding.chart1.isHighlightPerTap = true
7575

7676
// chart.setUnit(" €");
7777
// chart.setDrawUnitsInChart(true);

chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ abstract class BarLineChartBase<T : BarLineScatterCandleBubbleData<IBarLineScatt
335335

336336
drawMarkers(canvas)
337337

338-
if (isLogEnabled) {
338+
if (isLogging) {
339339
val drawtime = (System.currentTimeMillis() - startTime)
340340
totalTime += drawtime
341341
drawCycles += 1
@@ -353,7 +353,7 @@ abstract class BarLineChartBase<T : BarLineScatterCandleBubbleData<IBarLineScatt
353353
}
354354

355355
protected open fun prepareValuePxMatrix() {
356-
if (isLogEnabled) {
356+
if (isLogging) {
357357
Timber.i("Preparing Value-Px Matrix, xMin: ${mXAxis.mAxisMinimum}, xMax: ${mXAxis.mAxisMaximum}, xDelta: ${mXAxis.axisRange}")
358358
}
359359

@@ -368,12 +368,12 @@ abstract class BarLineChartBase<T : BarLineScatterCandleBubbleData<IBarLineScatt
368368

369369
override fun notifyDataSetChanged() {
370370
if (mData == null) {
371-
if (isLogEnabled) {
371+
if (isLogging) {
372372
Timber.i("Preparing... DATA NOT SET.")
373373
}
374374
return
375375
} else {
376-
if (isLogEnabled) {
376+
if (isLogging) {
377377
Timber.i("Preparing...")
378378
}
379379
}
@@ -522,7 +522,7 @@ abstract class BarLineChartBase<T : BarLineScatterCandleBubbleData<IBarLineScatt
522522

523523
viewPortHandler.restrainViewPort(max(minOffset, offsetLeft), max(minOffset, offsetTop), max(minOffset, offsetRight), max(minOffset, offsetBottom))
524524

525-
if (isLogEnabled) {
525+
if (isLogging) {
526526
Timber.i("offsetLeft: $offsetLeft, offsetTop: $offsetTop, offsetRight: $offsetRight, offsetBottom: $offsetBottom")
527527
Timber.i("Content: ${viewPortHandler.contentRect}")
528528
}

chartLib/src/main/kotlin/info/appdev/charting/charts/Chart.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
5353
/**
5454
* Returns true if log-output is enabled for the chart, fals if not.
5555
*/
56-
var isLogEnabled: Boolean = false
56+
var isLogging = false
5757

5858
/**
5959
* object that holds all data that was originally set for the chart, before
@@ -65,12 +65,12 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
6565
* Set this to false to prevent values from being highlighted by tap gesture.
6666
* Values can still be highlighted via drag or programmatically. Default: true
6767
*/
68-
var isHighlightPerTapEnabled: Boolean = true
68+
var isHighlightPerTap = true
6969

7070
/**
7171
* If set to true, chart continues to scroll after touch up
7272
*/
73-
var isDragDecelerationEnabled: Boolean = true
73+
var isDragDeceleration = true
7474

7575
/**
7676
* Deceleration friction coefficient in [0 ; 1] interval, higher values
@@ -221,7 +221,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
221221
mInfoPaint.textAlign = Align.CENTER
222222
mInfoPaint.textSize = 12f.convertDpToPixel()
223223

224-
if (this.isLogEnabled) {
224+
if (this.isLogging) {
225225
Timber.i("Chart.init()")
226226

227227
// enable being detected by ScreenReader
@@ -535,7 +535,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
535535
if (high == null) {
536536
this.highlighted = null
537537
} else {
538-
if (this.isLogEnabled) {
538+
if (this.isLogging) {
539539
Timber.i("Highlighted: $high")
540540
}
541541

@@ -1051,7 +1051,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
10511051
// let the chart know there is new data
10521052
notifyDataSetChanged()
10531053

1054-
if (isLogEnabled) {
1054+
if (isLogging) {
10551055
Timber.i("Data is set.")
10561056
}
10571057
}
@@ -1203,17 +1203,17 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
12031203
}
12041204

12051205
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
1206-
if (this.isLogEnabled) {
1206+
if (this.isLogging) {
12071207
Timber.i("OnSizeChanged()")
12081208
}
12091209

12101210
if (w > 0 && h > 0 && w < 10000 && h < 10000) {
1211-
if (this.isLogEnabled) {
1211+
if (this.isLogging) {
12121212
Timber.i("Setting chart dimens, width: $w, height: $h")
12131213
}
12141214
viewPortHandler.setChartDimens(w.toFloat(), h.toFloat())
12151215
} else {
1216-
if (this.isLogEnabled) {
1216+
if (this.isLogging) {
12171217
Timber.w("*Avoiding* setting chart dimens! width: $w, height: $h")
12181218
}
12191219
}

chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ open class HorizontalBarChart : BarChart {
182182
max(minOffset, offsetBottom)
183183
)
184184

185-
if (isLogEnabled) {
185+
if (isLogging) {
186186
Timber.i("offsetLeft: $offsetLeft, offsetTop: $offsetTop, offsetRight: $offsetRight, offsetBottom: $offsetBottom")
187187
Timber.i("Content: ${viewPortHandler.contentRect}")
188188
}
@@ -251,7 +251,7 @@ open class HorizontalBarChart : BarChart {
251251
*/
252252
override fun getHighlightByTouchPoint(x: Float, y: Float): Highlight? {
253253
if (mData == null) {
254-
if (isLogEnabled) {
254+
if (isLogging) {
255255
Timber.e("Can't select by touch. No data set.")
256256
}
257257
return null

chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ abstract class PieRadarChartBase<T : ChartData<out IDataSet<out Entry>>>
279279

280280
viewPortHandler.restrainViewPort(offsetLeft, offsetTop, offsetRight, offsetBottom)
281281

282-
if (isLogEnabled)
282+
if (isLogging)
283283
Timber.i("offsetLeft: $offsetLeft, offsetTop: $offsetTop, offsetRight: $offsetRight, offsetBottom: $offsetBottom")
284284
}
285285

chartLib/src/main/kotlin/info/appdev/charting/listener/BarLineChartTouchListener.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class BarLineChartTouchListener(
211211
if (abs(velocityX.toDouble()) > Utils.minimumFlingVelocity ||
212212
abs(velocityY.toDouble()) > Utils.minimumFlingVelocity
213213
) {
214-
if (touchMode == DRAG && chart.isDragDecelerationEnabled) {
214+
if (touchMode == DRAG && chart.isDragDeceleration) {
215215
stopDeceleration()
216216

217217
decelerationLastTime = AnimationUtils.currentAnimationTimeMillis()
@@ -502,7 +502,7 @@ class BarLineChartTouchListener(
502502

503503
chart.zoom(scaleX, scaleY, trans.x, trans.y)
504504

505-
if (chart.isLogEnabled)
505+
if (chart.isLogging)
506506
Timber.i("Double-Tap, Zooming In, x: ${trans.x} y: ${trans.y}")
507507

508508
onChartGestureListener?.onChartScale(e, scaleX, scaleY)
@@ -528,7 +528,7 @@ class BarLineChartTouchListener(
528528

529529
l?.onChartSingleTapped(e)
530530

531-
if (!chart.isHighlightPerTapEnabled) {
531+
if (!chart.isHighlightPerTap) {
532532
return false
533533
}
534534

0 commit comments

Comments
 (0)