Skip to content

Commit 9bef491

Browse files
committed
Rename properties without 'enabled'
1 parent 85ebb6d commit 9bef491

File tree

81 files changed

+415
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+415
-584
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ class AnotherBarActivity : DemoBase(), OnSeekBarChangeListener {
3737
binding.chart1.setMaxVisibleValueCount(60)
3838

3939
// scaling can now only be done on x- and y-axis separately
40-
binding.chart1.setPinchZoom(false)
40+
binding.chart1.isPinchZoom = false
4141

42-
binding.chart1.setDrawBarShadow(false)
42+
binding.chart1.isDrawBarShadow = false
4343
binding.chart1.setDrawGridBackground(false)
4444

4545
val xAxis = binding.chart1.xAxis
4646
xAxis.position = XAxisPosition.BOTTOM
47-
xAxis.setDrawGridLines(false)
47+
xAxis.isDrawGridLines = false
4848

49-
binding.chart1.axisLeft.setDrawGridLines(false)
49+
binding.chart1.axisLeft.isDrawGridLines = false
5050

5151
// setting data
5252
binding.seekBarX.progress = DEFAULT_VALUE
@@ -119,22 +119,18 @@ class AnotherBarActivity : DemoBase(), OnSeekBarChangeListener {
119119

120120
R.id.actionToggleHighlight -> {
121121
binding.chart1.barData?.let {
122-
it.isHighlightEnabled = !it.isHighlightEnabled
122+
it.isHighlight = !it.isHighlight
123123
}
124124
binding.chart1.invalidate()
125125
}
126126

127127
R.id.actionTogglePinch -> {
128-
if (binding.chart1.isPinchZoomEnabled)
129-
binding.chart1.setPinchZoom(false)
130-
else
131-
binding.chart1.setPinchZoom(true)
132-
128+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
133129
binding.chart1.invalidate()
134130
}
135131

136132
R.id.actionToggleAutoScaleMinMax -> {
137-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
133+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
138134
binding.chart1.notifyDataSetChanged()
139135
}
140136

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
5050
binding.chart1.setOnChartValueSelectedListener(this)
5151
binding.chart1.setRoundedBarRadius(50f)
5252

53-
binding.chart1.setDrawBarShadow(false)
54-
binding.chart1.setDrawValueAboveBar(true)
53+
binding.chart1.isDrawBarShadow = false
54+
binding.chart1.isDrawValueAboveBar = true
5555

5656
binding.chart1.description.isEnabled = false
5757

@@ -60,7 +60,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
6060
binding.chart1.setMaxVisibleValueCount(60)
6161

6262
// scaling can now only be done on x- and y-axis separately
63-
binding.chart1.setPinchZoom(false)
63+
binding.chart1.isPinchZoom = false
6464

6565
binding.chart1.setDrawGridBackground(false)
6666

@@ -70,7 +70,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
7070
binding.chart1.xAxis.apply {
7171
position = XAxisPosition.BOTTOM
7272
typeface = tfLight
73-
setDrawGridLines(false)
73+
isDrawGridLines = false
7474
granularity = 1f // only intervals of 1 day
7575
labelCount = 7
7676
valueFormatter = xAxisFormatter
@@ -88,7 +88,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
8888
}
8989

9090
binding.chart1.axisRight.apply {
91-
setDrawGridLines(false)
91+
isDrawGridLines = false
9292
typeface = tfLight
9393
setLabelCount(8, false)
9494
valueFormatter = custom
@@ -211,20 +211,18 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
211211

212212
R.id.actionToggleHighlight -> {
213213
binding.chart1.barData?.let {
214-
it.isHighlightEnabled = !it.isHighlightEnabled
214+
it.isHighlight = !it.isHighlight
215215
}
216216
binding.chart1.invalidate()
217217
}
218218

219219
R.id.actionTogglePinch -> {
220-
if (binding.chart1.isPinchZoomEnabled) binding.chart1.setPinchZoom(false)
221-
else binding.chart1.setPinchZoom(true)
222-
220+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
223221
binding.chart1.invalidate()
224222
}
225223

226224
R.id.actionToggleAutoScaleMinMax -> {
227-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
225+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
228226
binding.chart1.notifyDataSetChanged()
229227
}
230228

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
5050
// chart.setDrawBorders(true);
5151

5252
// scaling can now only be done on x- and y-axis separately
53-
binding.chart1.setPinchZoom(false)
53+
binding.chart1.isPinchZoom = false
5454

55-
binding.chart1.setDrawBarShadow(false)
55+
binding.chart1.isDrawBarShadow = false
5656

5757
binding.chart1.setDrawGridBackground(false)
5858

@@ -90,7 +90,7 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
9090
val leftAxis = binding.chart1.axisLeft
9191
leftAxis.typeface = tfLight
9292
leftAxis.valueFormatter = LargeValueFormatter()
93-
leftAxis.setDrawGridLines(false)
93+
leftAxis.isDrawGridLines = false
9494
leftAxis.spaceTop = 35f
9595
leftAxis.axisMinimum = 0f // this replaces setStartAtZero(true)
9696

@@ -193,14 +193,12 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
193193
}
194194

195195
R.id.actionTogglePinch -> {
196-
if (binding.chart1.isPinchZoomEnabled) binding.chart1.setPinchZoom(false)
197-
else binding.chart1.setPinchZoom(true)
198-
196+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
199197
binding.chart1.invalidate()
200198
}
201199

202200
R.id.actionToggleAutoScaleMinMax -> {
203-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
201+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
204202
binding.chart1.notifyDataSetChanged()
205203
}
206204

@@ -213,7 +211,7 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
213211

214212
R.id.actionToggleHighlight -> {
215213
binding.chart1.barData?.let {
216-
it.isHighlightEnabled = !it.isHighlightEnabled
214+
it.isHighlight = !it.isHighlight
217215
}
218216
binding.chart1.invalidate()
219217
}

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener {
3232
setContentView(binding.root)
3333

3434
dataSinus = assets.loadBarEntriesFromAssets("sinus_values.txt")
35-
binding.chart1.setDrawBarShadow(false)
36-
binding.chart1.setDrawValueAboveBar(true)
35+
binding.chart1.isDrawBarShadow = false
36+
binding.chart1.isDrawValueAboveBar = true
3737

3838
binding.chart1.description.isEnabled = false
3939

4040
// if more than 60 entries are displayed in the chart, no values will be drawn
4141
binding.chart1.setMaxVisibleValueCount(60)
4242

4343
// scaling can now only be done on x- and y-axis separately
44-
binding.chart1.setPinchZoom(false)
44+
binding.chart1.isPinchZoom = false
4545

4646
// draw shadows for each bar that show the maximum value
4747
// chart.setDrawBarShadow(true);
@@ -58,11 +58,11 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener {
5858
leftAxis.setLabelCount(6, false)
5959
leftAxis.axisMinimum = -2.5f
6060
leftAxis.axisMaximum = 2.5f
61-
leftAxis.isGranularityEnabled = true
61+
leftAxis.isGranularity = true
6262
leftAxis.granularity = 0.1f
6363

6464
val rightAxis = binding.chart1.axisRight
65-
rightAxis.setDrawGridLines(false)
65+
rightAxis.isDrawGridLines = false
6666
rightAxis.typeface = tfLight
6767
rightAxis.setLabelCount(6, false)
6868
rightAxis.axisMinimum = -2.5f
@@ -138,21 +138,18 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener {
138138

139139
R.id.actionToggleHighlight -> {
140140
binding.chart1.barData?.let {
141-
it.isHighlightEnabled = !it.isHighlightEnabled
141+
it.isHighlight = !it.isHighlight
142142
}
143143
binding.chart1.invalidate()
144144
}
145145

146146
R.id.actionTogglePinch -> {
147-
if (binding.chart1.isPinchZoomEnabled)
148-
binding.chart1.setPinchZoom(false)
149-
else binding.chart1.setPinchZoom(true)
150-
147+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
151148
binding.chart1.invalidate()
152149
}
153150

154151
R.id.actionToggleAutoScaleMinMax -> {
155-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
152+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
156153
binding.chart1.notifyDataSetChanged()
157154
}
158155

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ class BarChartPositiveNegative : DemoBase() {
3636
binding.chart1.extraLeftOffset = 70f
3737
binding.chart1.extraRightOffset = 70f
3838

39-
binding.chart1.setDrawBarShadow(false)
40-
binding.chart1.setDrawValueAboveBar(true)
39+
binding.chart1.isDrawBarShadow = false
40+
binding.chart1.isDrawValueAboveBar = true
4141

4242
binding.chart1.description.isEnabled = false
4343

4444
// scaling can now only be done on x- and y-axis separately
45-
binding.chart1.setPinchZoom(false)
45+
binding.chart1.isPinchZoom = false
4646

4747
binding.chart1.setDrawGridBackground(false)
4848

4949
val xAxis = binding.chart1.xAxis
5050
xAxis.position = XAxisPosition.BOTTOM
5151
xAxis.typeface = tfRegular
52-
xAxis.setDrawGridLines(false)
53-
xAxis.setDrawAxisLine(false)
52+
xAxis.isDrawGridLines = false
53+
xAxis.isDrawAxisLine = false
5454
xAxis.textColor = Color.LTGRAY
5555
xAxis.textSize = 13f
5656
xAxis.labelCount = 5
@@ -61,9 +61,9 @@ class BarChartPositiveNegative : DemoBase() {
6161
left.setDrawLabels(false)
6262
left.spaceTop = 25f
6363
left.spaceBottom = 25f
64-
left.setDrawAxisLine(false)
65-
left.setDrawGridLines(false)
66-
left.setDrawZeroLine(true) // draw a zero line
64+
left.isDrawAxisLine = false
65+
left.isDrawGridLines = false
66+
left.isDrawZeroLine = true // draw a zero line
6767
left.zeroLineColor = Color.GRAY
6868
left.zeroLineWidth = 0.7f
6969
binding.chart1.axisRight.isEnabled = false

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel
4949
binding.chart1.setScaleEnabled(true)
5050

5151
binding.chart1.setMaxVisibleValueCount(200)
52-
binding.chart1.setPinchZoom(true)
52+
binding.chart1.isPinchZoom = true
5353

5454
binding.seekBarX.progress = 10
5555
binding.seekBarY.progress = 50
@@ -66,7 +66,7 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel
6666
yl.typeface = tfLight
6767
yl.spaceTop = 30f
6868
yl.spaceBottom = 30f
69-
yl.setDrawZeroLine(false)
69+
yl.isDrawZeroLine = false
7070

7171
binding.chart1.axisRight.isEnabled = false
7272

@@ -169,20 +169,18 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel
169169

170170
R.id.actionToggleHighlight -> {
171171
binding.chart1.bubbleData?.let {
172-
it.isHighlightEnabled = !it.isHighlightEnabled
172+
it.isHighlight = !it.isHighlight
173173
}
174174
binding.chart1.invalidate()
175175
}
176176

177177
R.id.actionTogglePinch -> {
178-
if (binding.chart1.isPinchZoomEnabled) binding.chart1.setPinchZoom(false)
179-
else binding.chart1.setPinchZoom(true)
180-
178+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
181179
binding.chart1.invalidate()
182180
}
183181

184182
R.id.actionToggleAutoScaleMinMax -> {
185-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
183+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
186184
binding.chart1.notifyDataSetChanged()
187185
}
188186

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ class CandleStickChartActivity : DemoBase(), OnSeekBarChangeListener {
4040
binding.chart1.setMaxVisibleValueCount(60)
4141

4242
// scaling can now only be done on x- and y-axis separately
43-
binding.chart1.setPinchZoom(false)
43+
binding.chart1.isPinchZoom = false
4444

4545
binding.chart1.setDrawGridBackground(false)
4646

4747
val xAxis = binding.chart1.xAxis
4848
xAxis.position = XAxisPosition.BOTTOM
49-
xAxis.setDrawGridLines(false)
49+
xAxis.isDrawGridLines = false
5050

5151
val leftAxis = binding.chart1.axisLeft
5252
// leftAxis.setEnabled(false);
5353
leftAxis.setLabelCount(7, false)
54-
leftAxis.setDrawGridLines(false)
55-
leftAxis.setDrawAxisLine(false)
54+
leftAxis.isDrawGridLines = false
55+
leftAxis.isDrawAxisLine = false
5656

5757
val rightAxis = binding.chart1.axisRight
5858
rightAxis.isEnabled = false
@@ -150,20 +150,18 @@ class CandleStickChartActivity : DemoBase(), OnSeekBarChangeListener {
150150

151151
R.id.actionToggleHighlight -> {
152152
binding.chart1.candleData?.let {
153-
it.isHighlightEnabled = !it.isHighlightEnabled
153+
it.isHighlight = !it.isHighlight
154154
}
155155
binding.chart1.invalidate()
156156
}
157157

158158
R.id.actionTogglePinch -> {
159-
if (binding.chart1.isPinchZoomEnabled) binding.chart1.setPinchZoom(false)
160-
else binding.chart1.setPinchZoom(true)
161-
159+
binding.chart1.isPinchZoom = !binding.chart1.isPinchZoom
162160
binding.chart1.invalidate()
163161
}
164162

165163
R.id.actionToggleAutoScaleMinMax -> {
166-
binding.chart1.isAutoScaleMinMaxEnabled = !binding.chart1.isAutoScaleMinMaxEnabled
164+
binding.chart1.isAutoScaleMinMax = !binding.chart1.isAutoScaleMinMax
167165
binding.chart1.notifyDataSetChanged()
168166
}
169167

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class CombinedChartActivity : DemoBase() {
4747
binding.chart1.description.isEnabled = false
4848
binding.chart1.setBackgroundColor(Color.WHITE)
4949
binding.chart1.setDrawGridBackground(false)
50-
binding.chart1.setDrawBarShadow(false)
51-
binding.chart1.isHighlightFullBarEnabled = false
50+
binding.chart1.isDrawBarShadow = false
51+
binding.chart1.isHighlightFullBar = false
5252

5353
// draw bars behind lines
5454
binding.chart1.drawOrder = mutableListOf(
@@ -64,11 +64,11 @@ class CombinedChartActivity : DemoBase() {
6464
}
6565

6666
val rightAxis = binding.chart1.axisRight
67-
rightAxis.setDrawGridLines(false)
67+
rightAxis.isDrawGridLines = false
6868
rightAxis.axisMinimum = 0f // this replaces setStartAtZero(true)
6969

7070
val leftAxis = binding.chart1.axisLeft
71-
leftAxis.setDrawGridLines(false)
71+
leftAxis.isDrawGridLines = false
7272
leftAxis.axisMinimum = 0f // this replaces setStartAtZero(true)
7373

7474
val xAxis = binding.chart1.xAxis

0 commit comments

Comments
 (0)