Skip to content

Commit b5fdc01

Browse files
committed
Kotlin formatter
1 parent ddee945 commit b5fdc01

File tree

10 files changed

+38
-43
lines changed

10 files changed

+38
-43
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import com.github.mikephil.charting.listener.OnChartValueSelectedListener
3131
import com.github.mikephil.charting.utils.Fill
3232
import com.github.mikephil.charting.utils.MPPointF
3333
import info.appdev.chartexample.DataTools.Companion.getValues
34-
import info.appdev.chartexample.custom.DayAxisValueFormatter
35-
import info.appdev.chartexample.custom.MyAxisValueFormatter
34+
import info.appdev.chartexample.formatter.DayAxisValueFormatter
35+
import info.appdev.chartexample.formatter.MyAxisValueFormatter
3636
import info.appdev.chartexample.custom.XYMarkerView
3737
import info.appdev.chartexample.notimportant.DemoBase
3838

app/src/main/java/info/appdev/chartexample/ListViewBarChartActivity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import androidx.core.net.toUri
2727
/**
2828
* Demonstrates the use of charts inside a ListView. IMPORTANT: provide a
2929
* specific height attribute for the chart inside your ListView item
30-
*
31-
* @author Philipp Jahoda
3230
*/
3331
class ListViewBarChartActivity : DemoBase() {
3432
override fun onCreate(savedInstanceState: Bundle?) {

app/src/main/java/info/appdev/chartexample/StackedBarActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import com.github.mikephil.charting.interfaces.datasets.IBarDataSet
2626
import com.github.mikephil.charting.listener.OnChartValueSelectedListener
2727
import com.github.mikephil.charting.utils.ColorTemplate
2828
import info.appdev.chartexample.DataTools.Companion.getValues
29-
import info.appdev.chartexample.custom.MyAxisValueFormatter
30-
import info.appdev.chartexample.custom.MyValueFormatter
29+
import info.appdev.chartexample.formatter.MyAxisValueFormatter
30+
import info.appdev.chartexample.formatter.MyValueFormatter
3131
import info.appdev.chartexample.notimportant.DemoBase
3232

3333
class StackedBarActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener {

app/src/main/java/info/appdev/chartexample/custom/CustomScatterShapeRenderer.java

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package info.appdev.chartexample.custom
2+
3+
import android.graphics.Canvas
4+
import android.graphics.Paint
5+
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet
6+
import com.github.mikephil.charting.renderer.scatter.IShapeRenderer
7+
import com.github.mikephil.charting.utils.Utils
8+
import com.github.mikephil.charting.utils.ViewPortHandler
9+
10+
/**
11+
* Custom shape renderer that draws a single line.
12+
*/
13+
class CustomScatterShapeRenderer : IShapeRenderer {
14+
override fun renderShape(
15+
canvas: Canvas, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler?,
16+
posX: Float, posY: Float, renderPaint: Paint
17+
) {
18+
val shapeHalf = Utils.convertDpToPixel(dataSet.getScatterShapeSize()) / 2f
19+
20+
canvas.drawLine(
21+
posX - shapeHalf,
22+
posY - shapeHalf,
23+
posX + shapeHalf,
24+
posY + shapeHalf,
25+
renderPaint
26+
)
27+
}
28+
}

app/src/main/java/info/appdev/chartexample/custom/DayAxisValueFormatter.kt renamed to app/src/main/java/info/appdev/chartexample/formatter/DayAxisValueFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.appdev.chartexample.custom
1+
package info.appdev.chartexample.formatter
22

33
import com.github.mikephil.charting.charts.BarLineChartBase
44
import com.github.mikephil.charting.components.AxisBase

app/src/main/java/info/appdev/chartexample/custom/MyAxisValueFormatter.kt renamed to app/src/main/java/info/appdev/chartexample/formatter/MyAxisValueFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.appdev.chartexample.custom
1+
package info.appdev.chartexample.formatter
22

33
import com.github.mikephil.charting.components.AxisBase
44
import com.github.mikephil.charting.formatter.IAxisValueFormatter

app/src/main/java/info/appdev/chartexample/custom/MyFillFormatter.kt renamed to app/src/main/java/info/appdev/chartexample/formatter/MyFillFormatter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.appdev.chartexample.custom
1+
package info.appdev.chartexample.formatter
22

33
import com.github.mikephil.charting.formatter.IFillFormatter
44
import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider
@@ -10,4 +10,4 @@ class MyFillFormatter(private val fillPos: Float) : IFillFormatter {
1010
// your logic could be here
1111
return fillPos
1212
}
13-
}
13+
}

app/src/main/java/info/appdev/chartexample/custom/MyValueFormatter.kt renamed to app/src/main/java/info/appdev/chartexample/formatter/MyValueFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.appdev.chartexample.custom
1+
package info.appdev.chartexample.formatter
22

33
import com.github.mikephil.charting.data.Entry
44
import com.github.mikephil.charting.formatter.IValueFormatter

app/src/main/java/info/appdev/chartexample/custom/YearXAxisFormatter.kt renamed to app/src/main/java/info/appdev/chartexample/formatter/YearXAxisFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package info.appdev.chartexample.custom
1+
package info.appdev.chartexample.formatter
22

33
import com.github.mikephil.charting.components.AxisBase
44
import com.github.mikephil.charting.formatter.IAxisValueFormatter

0 commit comments

Comments
 (0)