diff --git a/app/src/androidTest/kotlin/info/appdev/chartexample/PieTest.kt b/app/src/androidTest/kotlin/info/appdev/chartexample/PieTest.kt index 04d866a2c..c5161df90 100644 --- a/app/src/androidTest/kotlin/info/appdev/chartexample/PieTest.kt +++ b/app/src/androidTest/kotlin/info/appdev/chartexample/PieTest.kt @@ -36,7 +36,7 @@ class PieTest { for (x in 10..50 step 10) { onView(withId(R.id.seekBarX)).perform(setProgress(x)) onView(ViewMatchers.isRoot()) - .perform(captureToBitmap { bitmap: Bitmap -> bitmap.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}1-${x}")}) + .perform(captureToBitmap { bitmap: Bitmap -> bitmap.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}1-${x}") }) } for (x in 50..200 step 50) { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7850e0641..4eb165a0f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ - + + diff --git a/app/src/main/kotlin/info/appdev/chartexample/AnotherBarActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/AnotherBarActivity.kt index c4bda6378..989097979 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/AnotherBarActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/AnotherBarActivity.kt @@ -10,15 +10,15 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityBarchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData import info.appdev.charting.data.BarDataSet import info.appdev.charting.data.BarEntry import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityBarchartBinding -import info.appdev.chartexample.notimportant.DemoBase class AnotherBarActivity : DemoBase(), OnSeekBarChangeListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt index 1b0e3ffa7..0f094c506 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivity.kt @@ -12,6 +12,12 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.XYMarkerView +import info.appdev.chartexample.databinding.ActivityBarchartBinding +import info.appdev.chartexample.formatter.DayAxisValueFormatter +import info.appdev.chartexample.formatter.MyAxisValueFormatter +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.components.XAxis.XAxisPosition @@ -27,12 +33,6 @@ import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.Fill 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 -import info.appdev.chartexample.formatter.DayAxisValueFormatter -import info.appdev.chartexample.formatter.MyAxisValueFormatter -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { @@ -142,7 +142,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect binding.chart1.barData!!.dataSetCount > 0 ) { set1 = binding.chart1.barData!!.getDataSetByIndex(0) as BarDataSet - set1.entries = values + set1.entries = values binding.chart1.barData?.notifyDataChanged() binding.chart1.notifyDataSetChanged() } else { diff --git a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivityMultiDataset.kt b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivityMultiDataset.kt index 2c87cbfaf..46065602a 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivityMultiDataset.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivityMultiDataset.kt @@ -11,6 +11,10 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.MyMarkerView +import info.appdev.chartexample.databinding.ActivityBarchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.AxisBase import info.appdev.charting.components.Legend import info.appdev.charting.data.BarData @@ -21,10 +25,6 @@ import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.formatter.LargeValueFormatter import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.custom.MyMarkerView -import info.appdev.chartexample.databinding.ActivityBarchartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber import java.util.Locale diff --git a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivitySinus.kt b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivitySinus.kt index f67cf92e7..ac6be2c32 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BarChartActivitySinus.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BarChartActivitySinus.kt @@ -11,14 +11,14 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.databinding.ActivityBarchartSinusBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.data.BarData import info.appdev.charting.data.BarDataSet import info.appdev.charting.data.BarEntry import info.appdev.charting.utils.loadBarEntriesFromAssets -import info.appdev.chartexample.databinding.ActivityBarchartSinusBinding -import info.appdev.chartexample.notimportant.DemoBase class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener { @@ -65,7 +65,7 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener { rightAxis.setDrawGridLines(false) rightAxis.typeface = tfLight rightAxis.setLabelCount(6, false) - rightAxis.axisMinimum = -2.5f + rightAxis.axisMinimum = -2.5f rightAxis.axisMaximum = 2.5f rightAxis.granularity = 0.1f diff --git a/app/src/main/kotlin/info/appdev/chartexample/BarChartPositiveNegative.kt b/app/src/main/kotlin/info/appdev/chartexample/BarChartPositiveNegative.kt index 0e965e2ff..7e7cce347 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BarChartPositiveNegative.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BarChartPositiveNegative.kt @@ -6,6 +6,8 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import androidx.core.net.toUri +import info.appdev.chartexample.databinding.ActivityBarchartNoseekbarBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.AxisBase import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData @@ -15,8 +17,6 @@ import info.appdev.charting.data.Entry import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.formatter.IValueFormatter import info.appdev.charting.utils.ViewPortHandler -import info.appdev.chartexample.databinding.ActivityBarchartNoseekbarBinding -import info.appdev.chartexample.notimportant.DemoBase import java.text.DecimalFormat import kotlin.math.max import kotlin.math.min @@ -109,7 +109,7 @@ class BarChartPositiveNegative : DemoBase() { binding.chart1.barData!!.dataSetCount > 0 ) { set = binding.chart1.barData!!.getDataSetByIndex(0) as BarDataSet - set.entries = values + set.entries = values binding.chart1.barData?.notifyDataChanged() binding.chart1.notifyDataSetChanged() } else { diff --git a/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt index bd76ad48a..7fdfe9c51 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/BubbleChartActivity.kt @@ -12,6 +12,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityBubblechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis import info.appdev.charting.data.BubbleData @@ -23,9 +26,6 @@ import info.appdev.charting.interfaces.datasets.IBubbleDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate 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 import timber.log.Timber class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/CandleStickChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/CandleStickChartActivity.kt index 086e716bd..ad5711a63 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/CandleStickChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/CandleStickChartActivity.kt @@ -13,14 +13,14 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityCandlechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.components.YAxis.AxisDependency import info.appdev.charting.data.CandleData import info.appdev.charting.data.CandleDataSet import info.appdev.charting.data.CandleEntry -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityCandlechartBinding -import info.appdev.chartexample.notimportant.DemoBase class CandleStickChartActivity : DemoBase(), OnSeekBarChangeListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/CombinedChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/CombinedChartActivity.kt index 0775b72c7..bde1f6dea 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/CombinedChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/CombinedChartActivity.kt @@ -6,6 +6,9 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityCombinedBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.charts.CombinedChart.DrawOrder import info.appdev.charting.components.AxisBase import info.appdev.charting.components.Legend @@ -28,9 +31,6 @@ import info.appdev.charting.data.ScatterData import info.appdev.charting.data.ScatterDataSet import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityCombinedBinding -import info.appdev.chartexample.notimportant.DemoBase import kotlin.math.roundToInt class CombinedChartActivity : DemoBase() { diff --git a/app/src/main/kotlin/info/appdev/chartexample/DataTools.kt b/app/src/main/kotlin/info/appdev/chartexample/DataTools.kt index ecd53b712..d9044958f 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/DataTools.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/DataTools.kt @@ -150,6 +150,7 @@ class DataTools { sin(i * stepSize) } } + fun getMuchValues(size: Int): Array { var result = VAL_102.copyOf(VAL_102.size) while (result.size < size) diff --git a/app/src/main/kotlin/info/appdev/chartexample/DrawChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/DrawChartActivity.kt index 51ad67b3d..f3856eb8a 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/DrawChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/DrawChartActivity.kt @@ -7,6 +7,8 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import androidx.core.content.ContextCompat +import info.appdev.chartexample.databinding.ActivityDrawChartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.data.DataSet import info.appdev.charting.data.Entry import info.appdev.charting.data.LineData @@ -14,8 +16,6 @@ import info.appdev.charting.data.LineDataSet import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.listener.OnDrawListener -import info.appdev.chartexample.databinding.ActivityDrawChartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber /** diff --git a/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt index 6539e90c2..1ec77d159 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HalfPieChartActivity.kt @@ -13,6 +13,9 @@ import android.view.MenuItem import android.widget.RelativeLayout import androidx.core.net.toUri import androidx.window.layout.WindowMetricsCalculator +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityPiechartHalfBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend import info.appdev.charting.data.PieData @@ -20,9 +23,6 @@ import info.appdev.charting.data.PieDataSet import info.appdev.charting.data.PieEntry import info.appdev.charting.formatter.PercentFormatter import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityPiechartHalfBinding -import info.appdev.chartexample.notimportant.DemoBase class HalfPieChartActivity : DemoBase() { diff --git a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt index 18cd96eff..106e82861 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarChartActivity.kt @@ -12,6 +12,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityHorizontalbarchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData @@ -22,9 +25,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener 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 import timber.log.Timber class HorizontalBarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt index dd71390a2..a7427804b 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/HorizontalBarNegativeChartActivity.kt @@ -12,6 +12,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityHorizontalbarchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData @@ -22,9 +25,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener 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 import timber.log.Timber class HorizontalBarNegativeChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/InvertedLineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/InvertedLineChartActivity.kt index db3f576b0..f2757140f 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/InvertedLineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/InvertedLineChartActivity.kt @@ -10,6 +10,10 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.MyMarkerView +import info.appdev.chartexample.databinding.ActivityLinechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.data.Entry import info.appdev.charting.data.LineData @@ -17,10 +21,6 @@ import info.appdev.charting.data.LineDataSet import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.EntryXComparator -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.custom.MyMarkerView -import info.appdev.chartexample.databinding.ActivityLinechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber import java.util.Collections diff --git a/app/src/main/kotlin/info/appdev/chartexample/LineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/LineChartActivity.kt index 05b0ffa27..c9b81110b 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/LineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/LineChartActivity.kt @@ -11,6 +11,10 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.setData +import info.appdev.chartexample.custom.MyMarkerView +import info.appdev.chartexample.databinding.ActivityLinechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.components.LimitLine @@ -20,10 +24,6 @@ import info.appdev.charting.data.Entry import info.appdev.charting.data.LineDataSet import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener -import info.appdev.chartexample.DataTools.Companion.setData -import info.appdev.chartexample.custom.MyMarkerView -import info.appdev.chartexample.databinding.ActivityLinechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber /** @@ -37,7 +37,7 @@ class LineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelec super.onCreate(savedInstanceState) binding = ActivityLinechartBinding.inflate(layoutInflater) setContentView(binding.root) - + binding.seekBarX.setOnSeekBarChangeListener(this) binding.seekBarY.max = 180 binding.seekBarY.setOnSeekBarChangeListener(this) diff --git a/app/src/main/kotlin/info/appdev/chartexample/LineChartDualAxisActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/LineChartDualAxisActivity.kt index cec1aaa79..c88414281 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/LineChartDualAxisActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/LineChartDualAxisActivity.kt @@ -28,9 +28,6 @@ import timber.log.Timber /** * Example of a dual axis [LineChart] with multiple data sets. - * - * @since 1.7.4 - * @version 3.1.0 */ class LineChartDualAxisActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/LineChartTimeActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/LineChartTimeActivity.kt index 8fda9d060..c38b31af5 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/LineChartTimeActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/LineChartTimeActivity.kt @@ -11,6 +11,9 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityLinechartTimeBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.AxisBase import info.appdev.charting.components.XAxis import info.appdev.charting.components.YAxis @@ -20,9 +23,6 @@ import info.appdev.charting.data.LineData import info.appdev.charting.data.LineDataSet import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.utils.ColorTemplate.holoBlue -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityLinechartTimeBinding -import info.appdev.chartexample.notimportant.DemoBase import java.text.SimpleDateFormat import java.util.Date import java.util.Locale diff --git a/app/src/main/kotlin/info/appdev/chartexample/ListViewMultiChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/ListViewMultiChartActivity.kt index cf1fc6b4d..944209e2a 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/ListViewMultiChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/ListViewMultiChartActivity.kt @@ -9,6 +9,14 @@ import android.view.MenuItem import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter +import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityListviewChartBinding +import info.appdev.chartexample.listviewitems.BarChartItem +import info.appdev.chartexample.listviewitems.ChartItem +import info.appdev.chartexample.listviewitems.LineChartItem +import info.appdev.chartexample.listviewitems.PieChartItem +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.data.BarData import info.appdev.charting.data.BarDataSet import info.appdev.charting.data.BarEntry @@ -20,14 +28,6 @@ import info.appdev.charting.data.PieDataSet import info.appdev.charting.data.PieEntry import info.appdev.charting.interfaces.datasets.ILineDataSet import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.listviewitems.BarChartItem -import info.appdev.chartexample.listviewitems.ChartItem -import info.appdev.chartexample.listviewitems.LineChartItem -import info.appdev.chartexample.listviewitems.PieChartItem -import info.appdev.chartexample.notimportant.DemoBase -import androidx.core.net.toUri -import info.appdev.chartexample.databinding.ActivityListviewChartBinding /** * Demonstrates the use of charts inside a ListView. IMPORTANT: provide a diff --git a/app/src/main/kotlin/info/appdev/chartexample/MultiLineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/MultiLineChartActivity.kt index 6da953cad..bc4aadcd4 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/MultiLineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/MultiLineChartActivity.kt @@ -11,6 +11,9 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityLinechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.data.Entry import info.appdev.charting.data.LineData @@ -21,9 +24,6 @@ import info.appdev.charting.listener.ChartTouchListener.ChartGesture import info.appdev.charting.listener.OnChartGestureListener import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityLinechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class MultiLineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartGestureListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/PerformanceLineChart.kt b/app/src/main/kotlin/info/appdev/chartexample/PerformanceLineChart.kt index c951ec4ce..4f88736aa 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PerformanceLineChart.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PerformanceLineChart.kt @@ -8,12 +8,12 @@ import android.view.MenuItem import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.net.toUri -import info.appdev.charting.data.Entry -import info.appdev.charting.data.LineData -import info.appdev.charting.data.LineDataSet import info.appdev.chartexample.DataTools.Companion.getMuchValues import info.appdev.chartexample.databinding.ActivityPerformanceLinechartBinding import info.appdev.chartexample.notimportant.DemoBase +import info.appdev.charting.data.Entry +import info.appdev.charting.data.LineData +import info.appdev.charting.data.LineDataSet class PerformanceLineChart : DemoBase(), OnSeekBarChangeListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt index 21ebd4f9b..6ae98d2c8 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartActivity.kt @@ -17,6 +17,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityPiechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend import info.appdev.charting.data.Entry @@ -28,9 +31,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate 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 import timber.log.Timber class PieChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt index d14269935..6e8ad6911 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PieChartRoundedActivity.kt @@ -17,6 +17,9 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityPiechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend import info.appdev.charting.data.Entry @@ -29,9 +32,6 @@ import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.renderer.PieChartRenderer import info.appdev.charting.utils.ColorTemplate 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 import timber.log.Timber class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { @@ -192,7 +192,7 @@ class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValu R.id.actionToggleMinAngles -> { if (binding.chart1.minAngleForSlices == 0f) - binding.chart1.minAngleForSlices =36f + binding.chart1.minAngleForSlices = 36f else binding.chart1.minAngleForSlices = 0f binding.chart1.notifyDataSetChanged() diff --git a/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt index 18926123f..14b6c6d22 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/PiePolylineChartActivity.kt @@ -16,6 +16,9 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityPiechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend import info.appdev.charting.data.Entry @@ -26,9 +29,6 @@ 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.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityPiechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class PiePolylineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { @@ -174,7 +174,7 @@ class PiePolylineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartVal R.id.actionToggleMinAngles -> { if (binding.chart1.minAngleForSlices == 0f) - binding.chart1.minAngleForSlices =36f + binding.chart1.minAngleForSlices = 36f else binding.chart1.minAngleForSlices = 0f binding.chart1.notifyDataSetChanged() diff --git a/app/src/main/kotlin/info/appdev/chartexample/RadarChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/RadarChartActivity.kt index 307927d87..75645bc07 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/RadarChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/RadarChartActivity.kt @@ -9,6 +9,10 @@ import android.view.Menu import android.view.MenuItem import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.RadarMarkerView +import info.appdev.chartexample.databinding.ActivityRadarchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.AxisBase import info.appdev.charting.components.Legend @@ -18,10 +22,6 @@ import info.appdev.charting.data.RadarDataSet import info.appdev.charting.data.RadarEntry import info.appdev.charting.formatter.IAxisValueFormatter import info.appdev.charting.interfaces.datasets.IRadarDataSet -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.custom.RadarMarkerView -import info.appdev.chartexample.databinding.ActivityRadarchartBinding -import info.appdev.chartexample.notimportant.DemoBase class RadarChartActivity : DemoBase() { diff --git a/app/src/main/kotlin/info/appdev/chartexample/RealtimeLineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/RealtimeLineChartActivity.kt index 84b9511a9..0a96a5232 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/RealtimeLineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/RealtimeLineChartActivity.kt @@ -10,6 +10,9 @@ import android.view.MenuItem import android.widget.Toast import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityRealtimeLinechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.components.YAxis.AxisDependency import info.appdev.charting.data.Entry @@ -18,9 +21,6 @@ import info.appdev.charting.data.LineDataSet import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityRealtimeLinechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class RealtimeLineChartActivity : DemoBase(), OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/ScatterChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/ScatterChartActivity.kt index e0ea67e63..db0923889 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/ScatterChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/ScatterChartActivity.kt @@ -10,6 +10,10 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.CustomScatterShapeRenderer +import info.appdev.chartexample.databinding.ActivityScatterchartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.charts.ScatterChart import info.appdev.charting.components.Legend import info.appdev.charting.data.Entry @@ -19,10 +23,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IScatterDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.custom.CustomScatterShapeRenderer -import info.appdev.chartexample.databinding.ActivityScatterchartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class ScatterChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/ScrollViewActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/ScrollViewActivity.kt index 2be6db20e..f6abbbf36 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/ScrollViewActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/ScrollViewActivity.kt @@ -5,14 +5,14 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityScrollviewBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData import info.appdev.charting.data.BarDataSet import info.appdev.charting.data.BarEntry import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityScrollviewBinding -import info.appdev.chartexample.notimportant.DemoBase class ScrollViewActivity : DemoBase() { diff --git a/app/src/main/kotlin/info/appdev/chartexample/SpecificPositionsLineChartActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/SpecificPositionsLineChartActivity.kt index eb240619f..50d1ba14e 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/SpecificPositionsLineChartActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/SpecificPositionsLineChartActivity.kt @@ -12,6 +12,10 @@ import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener import android.widget.Toast import androidx.core.content.ContextCompat +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.custom.MyMarkerView +import info.appdev.chartexample.databinding.ActivityLinechartBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.animation.Easing import info.appdev.charting.components.Legend.LegendForm import info.appdev.charting.components.LimitLine @@ -25,10 +29,6 @@ import info.appdev.charting.listener.ChartTouchListener.ChartGesture import info.appdev.charting.listener.OnChartGestureListener import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.getSDKInt -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.custom.MyMarkerView -import info.appdev.chartexample.databinding.ActivityLinechartBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class SpecificPositionsLineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartGestureListener, OnChartValueSelectedListener { diff --git a/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivity.kt index 17df2ebc4..a2efdd133 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivity.kt @@ -12,6 +12,11 @@ import android.widget.SeekBar.OnSeekBarChangeListener import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.databinding.ActivityBarchartBinding +import info.appdev.chartexample.formatter.MyAxisValueFormatter +import info.appdev.chartexample.formatter.MyValueFormatter +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData @@ -22,11 +27,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.databinding.ActivityBarchartBinding -import info.appdev.chartexample.formatter.MyAxisValueFormatter -import info.appdev.chartexample.formatter.MyValueFormatter -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber class StackedBarActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelectedListener { @@ -111,9 +111,10 @@ class StackedBarActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSele val set1: BarDataSet if (binding.chart1.barData != null && - binding.chart1.barData!!.dataSetCount > 0) { + binding.chart1.barData!!.dataSetCount > 0 + ) { set1 = binding.chart1.barData!!.getDataSetByIndex(0) as BarDataSet - set1.entries = values + set1.entries = values binding.chart1.barData?.notifyDataChanged() binding.chart1.notifyDataSetChanged() } else { diff --git a/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivityNegative.kt b/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivityNegative.kt index 3e79cbdb5..3f48e0dd6 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivityNegative.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/StackedBarActivityNegative.kt @@ -10,6 +10,8 @@ import android.view.MenuItem import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.net.toUri +import info.appdev.chartexample.databinding.ActivityAgeDistributionBinding +import info.appdev.chartexample.notimportant.DemoBase import info.appdev.charting.components.AxisBase import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis.XAxisPosition @@ -23,8 +25,6 @@ import info.appdev.charting.formatter.IValueFormatter import info.appdev.charting.highlight.Highlight import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.ViewPortHandler -import info.appdev.chartexample.databinding.ActivityAgeDistributionBinding -import info.appdev.chartexample.notimportant.DemoBase import timber.log.Timber import java.text.DecimalFormat import kotlin.math.abs 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 ce4078f6d..412361d08 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/compose/HorizontalBarComposeActivity.kt @@ -36,6 +36,9 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView import androidx.core.content.res.ResourcesCompat +import info.appdev.chartexample.DataTools.Companion.getValues +import info.appdev.chartexample.R +import info.appdev.chartexample.notimportant.DemoBaseCompose import info.appdev.charting.charts.HorizontalBarChart import info.appdev.charting.components.Legend import info.appdev.charting.components.XAxis.XAxisPosition @@ -47,9 +50,6 @@ import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.listener.OnChartValueSelectedListener import info.appdev.charting.utils.PointF -import info.appdev.chartexample.DataTools.Companion.getValues -import info.appdev.chartexample.R -import info.appdev.chartexample.notimportant.DemoBaseCompose import timber.log.Timber class HorizontalBarComposeActivity : DemoBaseCompose() { 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 5b4d77edb..3de94bcea 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/MyMarkerView.kt @@ -3,13 +3,13 @@ package info.appdev.chartexample.custom import android.annotation.SuppressLint import android.content.Context import android.widget.TextView +import info.appdev.chartexample.R 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.PointF import info.appdev.charting.utils.formatNumber -import info.appdev.chartexample.R /** * Custom implementation of the MarkerView. 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 a4889e30d..7c270133d 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/RadarMarkerView.kt @@ -4,11 +4,11 @@ import android.annotation.SuppressLint import android.content.Context import android.graphics.Typeface import android.widget.TextView +import info.appdev.chartexample.R import info.appdev.charting.components.MarkerView import info.appdev.charting.data.Entry import info.appdev.charting.highlight.Highlight import info.appdev.charting.utils.PointF -import info.appdev.chartexample.R import java.text.DecimalFormat /** 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 d1343e7de..62bd94cbc 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/StackedBarsMarkerView.kt @@ -3,13 +3,13 @@ package info.appdev.chartexample.custom import android.annotation.SuppressLint import android.content.Context import android.widget.TextView +import info.appdev.chartexample.R 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.PointF import info.appdev.charting.utils.formatNumber -import info.appdev.chartexample.R /** * Custom implementation of the MarkerView. 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 bc05fdc23..ffc7ce814 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/custom/XYMarkerView.kt @@ -3,12 +3,12 @@ package info.appdev.chartexample.custom import android.annotation.SuppressLint import android.content.Context import android.widget.TextView +import info.appdev.chartexample.R 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.PointF -import info.appdev.chartexample.R import java.text.DecimalFormat /** diff --git a/app/src/main/kotlin/info/appdev/chartexample/formatter/MyValueFormatter.kt b/app/src/main/kotlin/info/appdev/chartexample/formatter/MyValueFormatter.kt index 77a9460b7..a32ce5413 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/formatter/MyValueFormatter.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/formatter/MyValueFormatter.kt @@ -8,7 +8,7 @@ import java.text.DecimalFormat class MyValueFormatter : IValueFormatter { private val decimalFormat = DecimalFormat("###,###,###,##0.0") - override fun getFormattedValue(value: Float, entry: Entry?, dataSetIndex: Int, viewPortHandler: ViewPortHandler?): String? { + override fun getFormattedValue(value: Float, entry: Entry?, dataSetIndex: Int, viewPortHandler: ViewPortHandler?): String { return decimalFormat.format(value.toDouble()) + " $" } } diff --git a/app/src/main/kotlin/info/appdev/chartexample/fragments/BarChartFrag.kt b/app/src/main/kotlin/info/appdev/chartexample/fragments/BarChartFrag.kt index a54c2b2ac..2ede03704 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/fragments/BarChartFrag.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/fragments/BarChartFrag.kt @@ -19,6 +19,7 @@ class BarChartFrag : SimpleFragment(), OnChartGestureListener { private lateinit var chart: BarChart private var _binding: FragSimpleBarBinding? = null + // This property is only valid between onCreateView and onDestroyView. private val binding get() = _binding!! diff --git a/app/src/main/kotlin/info/appdev/chartexample/fragments/ScatterChartFrag.kt b/app/src/main/kotlin/info/appdev/chartexample/fragments/ScatterChartFrag.kt index fb2b5ee63..f85adcdad 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/fragments/ScatterChartFrag.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/fragments/ScatterChartFrag.kt @@ -6,10 +6,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment -import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.chartexample.R import info.appdev.chartexample.custom.MyMarkerView import info.appdev.chartexample.databinding.FragSimpleScatterBinding +import info.appdev.charting.components.XAxis.XAxisPosition class ScatterChartFrag : SimpleFragment() { private var _binding: FragSimpleScatterBinding? = null diff --git a/app/src/main/kotlin/info/appdev/chartexample/fragments/SimpleFragment.kt b/app/src/main/kotlin/info/appdev/chartexample/fragments/SimpleFragment.kt index 7016f7328..4d76b7a2d 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/fragments/SimpleFragment.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/fragments/SimpleFragment.kt @@ -7,6 +7,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment +import info.appdev.chartexample.DataTools.Companion.getValues import info.appdev.charting.charts.ScatterChart.ScatterShape import info.appdev.charting.data.BarData import info.appdev.charting.data.BarDataSet @@ -24,7 +25,6 @@ import info.appdev.charting.interfaces.datasets.ILineDataSet import info.appdev.charting.interfaces.datasets.IScatterDataSet import info.appdev.charting.utils.ColorTemplate import info.appdev.charting.utils.loadEntriesFromAssets -import info.appdev.chartexample.DataTools.Companion.getValues abstract class SimpleFragment : Fragment() { private var tf: Typeface? = null @@ -113,7 +113,7 @@ abstract class SimpleFragment : Fragment() { protected fun generateLineData(): LineData { val sets = ArrayList() val ds1 = LineDataSet(requireContext().assets.loadEntriesFromAssets("sine.txt"), "Sine function") - val ds2 = LineDataSet(requireContext().assets.loadEntriesFromAssets( "cosine.txt"), "Cosine function") + val ds2 = LineDataSet(requireContext().assets.loadEntriesFromAssets("cosine.txt"), "Cosine function") ds1.lineWidth = 2f ds2.lineWidth = 2f diff --git a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/BarChartItem.kt b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/BarChartItem.kt index 42ff28604..59fa91296 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/BarChartItem.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/BarChartItem.kt @@ -5,10 +5,10 @@ import android.content.Context import android.graphics.Typeface import android.view.LayoutInflater import android.view.View +import info.appdev.chartexample.R import info.appdev.charting.charts.BarChart import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.BarData -import info.appdev.chartexample.R class BarChartItem(chartData: BarData, context: Context) : ChartItem(chartData) { private val typeface: Typeface? = Typeface.createFromAsset(context.assets, "OpenSans-Regular.ttf") diff --git a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/LineChartItem.kt b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/LineChartItem.kt index 9e420e792..86c328495 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/LineChartItem.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/LineChartItem.kt @@ -5,10 +5,10 @@ import android.content.Context import android.graphics.Typeface import android.view.LayoutInflater import android.view.View +import info.appdev.chartexample.R import info.appdev.charting.charts.LineChart import info.appdev.charting.components.XAxis.XAxisPosition import info.appdev.charting.data.LineData -import info.appdev.chartexample.R class LineChartItem(lineData: LineData, context: Context) : ChartItem(lineData) { private val typeface: Typeface? = Typeface.createFromAsset(context.assets, "OpenSans-Regular.ttf") diff --git a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/PieChartItem.kt b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/PieChartItem.kt index c6fe060b5..174848104 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/listviewitems/PieChartItem.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/listviewitems/PieChartItem.kt @@ -10,12 +10,12 @@ import android.text.style.RelativeSizeSpan import android.text.style.StyleSpan import android.view.LayoutInflater import android.view.View +import info.appdev.chartexample.R import info.appdev.charting.charts.PieChart import info.appdev.charting.components.Legend import info.appdev.charting.data.PieData import info.appdev.charting.formatter.PercentFormatter import info.appdev.charting.utils.ColorTemplate -import info.appdev.chartexample.R class PieChartItem(pieData: PieData, context: Context) : ChartItem(pieData) { private val typeface: Typeface? = Typeface.createFromAsset(context.assets, "OpenSans-Regular.ttf") diff --git a/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBase.kt b/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBase.kt index 342725660..f97f5e3c3 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBase.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBase.kt @@ -16,9 +16,9 @@ import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsControllerCompat import androidx.core.view.get import androidx.core.view.size -import info.appdev.charting.charts.Chart import com.google.android.material.snackbar.Snackbar import info.appdev.chartexample.R +import info.appdev.charting.charts.Chart import java.text.DateFormatSymbols abstract class DemoBase : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback { diff --git a/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBaseCompose.kt b/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBaseCompose.kt index 4b8b44080..04cb3d9fd 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBaseCompose.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/notimportant/DemoBaseCompose.kt @@ -33,7 +33,8 @@ open class DemoBaseCompose : ComponentActivity() { protected fun > saveToGallery(chart: T) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) - == PackageManager.PERMISSION_GRANTED) { + == PackageManager.PERMISSION_GRANTED + ) { if (chart.saveToGallery("HorizontalBarChartActivity_" + System.currentTimeMillis(), 70)) { Toast.makeText(this, "Saving SUCCESSFUL!", Toast.LENGTH_SHORT).show() } else { diff --git a/app/src/main/kotlin/info/appdev/chartexample/notimportant/MainActivity.kt b/app/src/main/kotlin/info/appdev/chartexample/notimportant/MainActivity.kt index c8f06c2e3..930721fa9 100644 --- a/app/src/main/kotlin/info/appdev/chartexample/notimportant/MainActivity.kt +++ b/app/src/main/kotlin/info/appdev/chartexample/notimportant/MainActivity.kt @@ -41,8 +41,6 @@ import androidx.core.net.toUri import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsControllerCompat -import info.appdev.charting.utils.Utils -import info.appdev.charting.utils.initUtils import info.appdev.chartexample.AnotherBarActivity import info.appdev.chartexample.BarChartActivity import info.appdev.chartexample.BarChartActivityMultiDataset @@ -80,6 +78,8 @@ import info.appdev.chartexample.StackedBarActivityNegative import info.appdev.chartexample.TimeLineActivity import info.appdev.chartexample.compose.HorizontalBarComposeActivity import info.appdev.chartexample.fragments.ViewPagerSimpleChartDemo +import info.appdev.charting.utils.Utils +import info.appdev.charting.utils.initUtils class MainActivity : ComponentActivity() { diff --git a/app/src/main/res/anim/move_left_in_activity.xml b/app/src/main/res/anim/move_left_in_activity.xml index 086ea1223..c37ff9267 100644 --- a/app/src/main/res/anim/move_left_in_activity.xml +++ b/app/src/main/res/anim/move_left_in_activity.xml @@ -1,7 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/anim/move_left_out_activity.xml b/app/src/main/res/anim/move_left_out_activity.xml index 8ac6d51db..a9aca7488 100644 --- a/app/src/main/res/anim/move_left_out_activity.xml +++ b/app/src/main/res/anim/move_left_out_activity.xml @@ -1,7 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/anim/move_right_in_activity.xml b/app/src/main/res/anim/move_right_in_activity.xml index d16f775fe..2c0c9c720 100644 --- a/app/src/main/res/anim/move_right_in_activity.xml +++ b/app/src/main/res/anim/move_right_in_activity.xml @@ -1,7 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/anim/move_right_out_activity.xml b/app/src/main/res/anim/move_right_out_activity.xml index 948a4d90d..4325c4ad6 100644 --- a/app/src/main/res/anim/move_right_out_activity.xml +++ b/app/src/main/res/anim/move_right_out_activity.xml @@ -1,7 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/drawable/gradient_drawable_precipitation.xml b/app/src/main/res/drawable/gradient_drawable_precipitation.xml index b44afe7e7..2deb37c3b 100644 --- a/app/src/main/res/drawable/gradient_drawable_precipitation.xml +++ b/app/src/main/res/drawable/gradient_drawable_precipitation.xml @@ -1,8 +1,8 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_colored_lines.xml b/app/src/main/res/layout/activity_colored_lines.xml index ee93bb71a..b96cc1661 100644 --- a/app/src/main/res/layout/activity_colored_lines.xml +++ b/app/src/main/res/layout/activity_colored_lines.xml @@ -8,20 +8,23 @@ android:id="@+id/chart1" android:layout_weight="1" android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:layout_height="match_parent" /> + + android:layout_height="match_parent" /> + + android:layout_height="match_parent" /> + + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_combined.xml b/app/src/main/res/layout/activity_combined.xml index 81a5565b8..e6c704ea9 100644 --- a/app/src/main/res/layout/activity_combined.xml +++ b/app/src/main/res/layout/activity_combined.xml @@ -6,6 +6,6 @@ + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_linechart.xml b/app/src/main/res/layout/activity_linechart.xml index b42c133d8..a091acdd2 100644 --- a/app/src/main/res/layout/activity_linechart.xml +++ b/app/src/main/res/layout/activity_linechart.xml @@ -1,6 +1,5 @@ - diff --git a/app/src/main/res/layout/activity_linechart_time.xml b/app/src/main/res/layout/activity_linechart_time.xml index 339c7d83d..090c34b6b 100644 --- a/app/src/main/res/layout/activity_linechart_time.xml +++ b/app/src/main/res/layout/activity_linechart_time.xml @@ -18,7 +18,7 @@ android:layout_alignParentBottom="true" android:layout_marginLeft="8dp" android:layout_marginTop="8dp" - android:layout_toLeftOf="@+id/tvXMax"/> + android:layout_toLeftOf="@+id/tvXMax" /> - + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_realtime_linechart.xml b/app/src/main/res/layout/activity_realtime_linechart.xml index 00bbd2f28..88d72247d 100644 --- a/app/src/main/res/layout/activity_realtime_linechart.xml +++ b/app/src/main/res/layout/activity_realtime_linechart.xml @@ -6,6 +6,6 @@ + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/activity_scrollview.xml b/app/src/main/res/layout/activity_scrollview.xml index 9dfebb705..1d13aaf60 100644 --- a/app/src/main/res/layout/activity_scrollview.xml +++ b/app/src/main/res/layout/activity_scrollview.xml @@ -6,7 +6,7 @@ + android:orientation="vertical"> + android:orientation="vertical"> - + diff --git a/app/src/main/res/layout/frag_simple_line.xml b/app/src/main/res/layout/frag_simple_line.xml index 6ea0ccf6d..bd6981a8c 100644 --- a/app/src/main/res/layout/frag_simple_line.xml +++ b/app/src/main/res/layout/frag_simple_line.xml @@ -2,7 +2,7 @@ + android:orientation="vertical"> + android:orientation="vertical"> + android:orientation="vertical"> + android:padding="8dp"> + android:textSize="16sp" /> + android:orientation="vertical"> + android:orientation="vertical"> + android:orientation="vertical"> - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleBarBorders" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleHighlight" /> - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/animateX" /> - + android:title="@string/animateY" /> - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/bubble.xml b/app/src/main/res/menu/bubble.xml index 7b9ab5cd1..338e932a5 100644 --- a/app/src/main/res/menu/bubble.xml +++ b/app/src/main/res/menu/bubble.xml @@ -1,45 +1,35 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleHighlight" /> - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/animateX" /> - + android:title="@string/animateY" /> - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/candle.xml b/app/src/main/res/menu/candle.xml index 42a1a7e05..819c119b5 100644 --- a/app/src/main/res/menu/candle.xml +++ b/app/src/main/res/menu/candle.xml @@ -1,49 +1,38 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleHighlight" /> - + android:title="@string/actionToggleCandleShadow" /> - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/animateX" /> - + android:title="@string/animateY" /> - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/combined.xml b/app/src/main/res/menu/combined.xml index c7def2509..738858979 100644 --- a/app/src/main/res/menu/combined.xml +++ b/app/src/main/res/menu/combined.xml @@ -1,21 +1,17 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleLineValues" /> - + android:title="@string/actionToggleBarValues" /> - + android:title="@string/actionRemoveDataSet" /> diff --git a/app/src/main/res/menu/draw.xml b/app/src/main/res/menu/draw.xml index 36383db54..c3f27d418 100644 --- a/app/src/main/res/menu/draw.xml +++ b/app/src/main/res/menu/draw.xml @@ -1,32 +1,25 @@ - + - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleFilled" /> - + android:title="@string/actionToggleCircles" /> - - + - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/dynamical.xml b/app/src/main/res/menu/dynamical.xml index 68d4fab0c..bf860cb8d 100644 --- a/app/src/main/res/menu/dynamical.xml +++ b/app/src/main/res/menu/dynamical.xml @@ -1,33 +1,26 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionAddEntry" /> - + android:title="@string/actionRemoveEntry" /> - + android:title="@string/actionAddDataSet" /> - + android:title="@string/actionRemoveDataSet" /> - + android:title="@string/actionClearChart" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/line.xml b/app/src/main/res/menu/line.xml index a812b91b5..c41219528 100644 --- a/app/src/main/res/menu/line.xml +++ b/app/src/main/res/menu/line.xml @@ -1,65 +1,50 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleFilled" /> - + android:title="@string/actionToggleCircles" /> - + android:title="@string/actionToggleCubic" /> - + android:title="@string/actionToggleStepped" /> - + android:title="@string/actionToggleHorizontalCubic" /> - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/actionToggleHighlight" /> - - + - - + - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml index 9ac13dbba..2dac5465a 100644 --- a/app/src/main/res/menu/main.xml +++ b/app/src/main/res/menu/main.xml @@ -1,17 +1,14 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/reportProblem" /> - + android:title="@string/viewWebsite" /> diff --git a/app/src/main/res/menu/only_github.xml b/app/src/main/res/menu/only_github.xml index c0a9b6693..c81aa3117 100644 --- a/app/src/main/res/menu/only_github.xml +++ b/app/src/main/res/menu/only_github.xml @@ -2,6 +2,5 @@ - + android:title="@string/viewGithub"> diff --git a/app/src/main/res/menu/pie.xml b/app/src/main/res/menu/pie.xml index 09a05a9cc..2ee502107 100644 --- a/app/src/main/res/menu/pie.xml +++ b/app/src/main/res/menu/pie.xml @@ -1,61 +1,47 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleYValues" /> - + android:title="@string/actionToggleXValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionTogglePercent" /> - + android:title="@string/actionToggleMinAngles" /> - + android:title="@string/actionToggleHole" /> - + android:title="@string/actionToggleCurvedSlices" /> - + android:title="@string/actionDrawCenterText" /> - + android:title="@string/actionToggleSpin" /> - + android:title="@string/animateX" /> - - + - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/radar.xml b/app/src/main/res/menu/radar.xml index 2a5c19cf8..254e60046 100644 --- a/app/src/main/res/menu/radar.xml +++ b/app/src/main/res/menu/radar.xml @@ -1,62 +1,48 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleFilled" /> - + android:title="@string/actionToggleHighlight" /> - + android:title="@string/actionToggleHighlightCircle" /> - + android:title="@string/actionToggleRotation" /> - + android:title="@string/actionToggleYValues" /> - + android:title="@string/actionToggleXValues" /> - + android:title="@string/actionToggleSpin" /> - + android:title="@string/animateX" /> - + android:title="@string/animateY" /> - + android:title="@string/animateXY" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/realtime.xml b/app/src/main/res/menu/realtime.xml index 48cc7ccd0..871013d3f 100644 --- a/app/src/main/res/menu/realtime.xml +++ b/app/src/main/res/menu/realtime.xml @@ -1,25 +1,20 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionAddEntry" /> - + android:title="@string/actionClearChart" /> - + android:title="@string/actionFeedMultiple" /> - + android:title="@string/actionSave" /> diff --git a/app/src/main/res/menu/scatter.xml b/app/src/main/res/menu/scatter.xml index eb8e0efa6..7e5f14b9a 100644 --- a/app/src/main/res/menu/scatter.xml +++ b/app/src/main/res/menu/scatter.xml @@ -1,45 +1,35 @@ - + - + android:title="@string/viewGithub" /> - + android:title="@string/actionToggleValues" /> - + android:title="@string/actionToggleIcons" /> - + android:title="@string/actionToggleHighlight" /> - + android:title="@string/animateX" /> - + android:title="@string/animateY" /> - + android:title="@string/animateXY" /> - + android:title="@string/actionTogglePinch" /> - + android:title="@string/actionToggleAutoScale" /> - + android:title="@string/actionSave" /> diff --git a/chartLib/src/main/kotlin/com/github/mikephil/charting/charts/BarChart.kt b/chartLib/src/main/kotlin/com/github/mikephil/charting/charts/BarChart.kt index b52f5e0d4..c534e929b 100644 --- a/chartLib/src/main/kotlin/com/github/mikephil/charting/charts/BarChart.kt +++ b/chartLib/src/main/kotlin/com/github/mikephil/charting/charts/BarChart.kt @@ -7,8 +7,10 @@ import android.util.Log open class BarChart : info.appdev.charting.charts.BarChart { @Deprecated("Use same class from package info.appdev.charting.charts instead") constructor(context: Context?) : super(context) + @Deprecated("Use same class from package info.appdev.charting.charts instead") constructor(context: Context?, attrs: android.util.AttributeSet?) : super(context, attrs) + @Deprecated("Use same class from package info.appdev.charting.charts instead") constructor(context: Context?, attrs: android.util.AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) 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 3cc0c1b69..aa5a244a3 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/BarLineChartBase.kt @@ -425,19 +425,23 @@ abstract class BarLineChartBase offsets.right += min( legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent ) + legend.xOffset + LegendHorizontalAlignment.CENTER -> when (legend.verticalAlignment) { LegendVerticalAlignment.TOP -> offsets.top += min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + legend.yOffset + LegendVerticalAlignment.BOTTOM -> offsets.bottom += min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + legend.yOffset + else -> {} } } @@ -447,10 +451,12 @@ abstract class BarLineChartBase offsets.bottom += min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + legend.yOffset + else -> {} } } diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/Chart.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/Chart.kt index 28b807585..d60d03139 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/Chart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/Chart.kt @@ -478,7 +478,7 @@ abstract class Chart>> : ViewGroup, IBaseP fun highlightValue(x: Float, dataSetIndex: Int, callListener: Boolean) { highlightValue(x, Float.NaN, dataSetIndex, -1, callListener) } - + /** * Highlights the value at the given x-value and y-value in the given DataSet. * Provide -1 as the dataSetIndex to undo all highlighting. @@ -1029,30 +1029,30 @@ abstract class Chart>> : ViewGroup, IBaseP override var data: T? get() = mData set(value) { - mData = value - - if (value == null) { - mOffsetsCalculated = false - return - } + mData = value + if (value == null) { mOffsetsCalculated = false + return + } - // calculate how many digits are needed - setupDefaultFormatter(value.yMin, value.yMax) + mOffsetsCalculated = false - for (set in mData!!.dataSets!!) { - if (set.needsFormatter() || set.valueFormatter === mDefaultValueFormatter) { - set.valueFormatter = mDefaultValueFormatter - } + // calculate how many digits are needed + setupDefaultFormatter(value.yMin, value.yMax) + + for (set in mData!!.dataSets!!) { + if (set.needsFormatter() || set.valueFormatter === mDefaultValueFormatter) { + set.valueFormatter = mDefaultValueFormatter } + } - // let the chart know there is new data - notifyDataSetChanged() + // let the chart know there is new data + notifyDataSetChanged() - if (isLogEnabled) { - Timber.i("Data is set.") - } + if (isLogEnabled) { + Timber.i("Data is set.") + } } var renderer: DataRenderer? diff --git a/chartLib/src/main/kotlin/info/appdev/charting/charts/CombinedChart.kt b/chartLib/src/main/kotlin/info/appdev/charting/charts/CombinedChart.kt index cb8cfa813..ee9712653 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/CombinedChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/CombinedChart.kt @@ -46,11 +46,11 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider protected var drawOrders: MutableList? = null - lateinit var barDataProvider : BarDataProvider - lateinit var lineDataProvider : LineDataProvider - lateinit var bubbleDataProvider : BubbleDataProvider - lateinit var scatterDataProvider : ScatterDataProvider - lateinit var candleDataProvider : CandleDataProvider + lateinit var barDataProvider: BarDataProvider + lateinit var lineDataProvider: LineDataProvider + lateinit var bubbleDataProvider: BubbleDataProvider + lateinit var scatterDataProvider: ScatterDataProvider + lateinit var candleDataProvider: CandleDataProvider /** * enum that allows to specify the order in which the different data objects for the combined-chart are drawn @@ -80,15 +80,21 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var isDrawBarShadowEnabled: Boolean get() = this@CombinedChart.isDrawBarShadowEnabled - set(value) { this@CombinedChart.isDrawBarShadowEnabled = value } + set(value) { + this@CombinedChart.isDrawBarShadowEnabled = value + } override var isDrawValueAboveBarEnabled: Boolean get() = this@CombinedChart.isDrawValueAboveBarEnabled - set(value) { this@CombinedChart.isDrawValueAboveBarEnabled = value } + set(value) { + this@CombinedChart.isDrawValueAboveBarEnabled = value + } override var isHighlightFullBarEnabled: Boolean get() = this@CombinedChart.isHighlightFullBarEnabled - set(value) { this@CombinedChart.isHighlightFullBarEnabled = value } + set(value) { + this@CombinedChart.isHighlightFullBarEnabled = value + } override var data: BarData? get() = this@CombinedChart.barData @@ -123,7 +129,9 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var maxHighlightDistance: Float get() = this@CombinedChart.maxHighlightDistance - set(value) { this@CombinedChart.maxHighlightDistance = value } + set(value) { + this@CombinedChart.maxHighlightDistance = value + } override val centerOfView: info.appdev.charting.utils.PointF get() = this@CombinedChart.centerOfView @@ -171,7 +179,9 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var maxHighlightDistance: Float get() = this@CombinedChart.maxHighlightDistance - set(value) { this@CombinedChart.maxHighlightDistance = value } + set(value) { + this@CombinedChart.maxHighlightDistance = value + } override val centerOfView: info.appdev.charting.utils.PointF get() = this@CombinedChart.centerOfView @@ -225,7 +235,9 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var maxHighlightDistance: Float get() = this@CombinedChart.maxHighlightDistance - set(value) { this@CombinedChart.maxHighlightDistance = value } + set(value) { + this@CombinedChart.maxHighlightDistance = value + } override val centerOfView: info.appdev.charting.utils.PointF get() = this@CombinedChart.centerOfView @@ -279,7 +291,9 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var maxHighlightDistance: Float get() = this@CombinedChart.maxHighlightDistance - set(value) { this@CombinedChart.maxHighlightDistance = value } + set(value) { + this@CombinedChart.maxHighlightDistance = value + } override val centerOfView: info.appdev.charting.utils.PointF get() = this@CombinedChart.centerOfView @@ -333,7 +347,9 @@ open class CombinedChart : BarLineChartBase, CombinedDataProvider override var maxHighlightDistance: Float get() = this@CombinedChart.maxHighlightDistance - set(value) { this@CombinedChart.maxHighlightDistance = value } + set(value) { + this@CombinedChart.maxHighlightDistance = value + } override val centerOfView: info.appdev.charting.utils.PointF get() = this@CombinedChart.centerOfView 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 e4cbcfae3..7f2c4b734 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/HorizontalBarChart.kt @@ -68,22 +68,27 @@ open class HorizontalBarChart : BarChart { legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent ) + legend.xOffset + LegendHorizontalAlignment.RIGHT -> offsets.right += min( legend.neededWidth, viewPortHandler.chartWidth * legend.maxSizePercent ) + legend.xOffset + LegendHorizontalAlignment.CENTER -> when (legend.verticalAlignment) { LegendVerticalAlignment.TOP -> offsets.top += min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + legend.yOffset + LegendVerticalAlignment.BOTTOM -> offsets.bottom += min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + legend.yOffset + else -> {} } } + LegendOrientation.HORIZONTAL -> when (legend.verticalAlignment) { LegendVerticalAlignment.TOP -> { offsets.top += min( @@ -97,6 +102,7 @@ open class HorizontalBarChart : BarChart { ) } } + LegendVerticalAlignment.BOTTOM -> { offsets.bottom += min( legend.neededHeight, @@ -109,6 +115,7 @@ open class HorizontalBarChart : BarChart { ) } } + else -> {} } } 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 6b5a50796..ff91213d6 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/charts/PieRadarChartBase.kt @@ -140,6 +140,7 @@ abstract class PieRadarChartBase>> } } } + LegendOrientation.HORIZONTAL -> { when (legend.verticalAlignment) { LegendVerticalAlignment.TOP -> legendTop = fullLegendHeight @@ -214,14 +215,17 @@ abstract class PieRadarChartBase>> legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + LegendVerticalAlignment.BOTTOM -> legendBottom = min( legend.neededHeight, viewPortHandler.chartHeight * legend.maxSizePercent ) + LegendVerticalAlignment.CENTER -> Timber.e("LegendCenter/VerticalCenter not supported for PieRadarChart") } } } + LegendOrientation.HORIZONTAL -> { val yLegendOffset: Float diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt index 7c876ecbb..b6ba10045 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt @@ -6,19 +6,11 @@ import info.appdev.charting.utils.ColorTemplate import info.appdev.charting.utils.FSize import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.calcTextHeight +import info.appdev.charting.utils.calcTextSize import info.appdev.charting.utils.calcTextWidth import info.appdev.charting.utils.convertDpToPixel -import info.appdev.charting.utils.calcTextSize import info.appdev.charting.utils.getLineHeight import info.appdev.charting.utils.getLineSpacing -import kotlin.Array -import kotlin.Boolean -import kotlin.IntArray -import kotlin.String -import kotlin.arrayOf -import kotlin.collections.ArrayList -import kotlin.collections.MutableList -import kotlin.collections.toTypedArray import kotlin.math.max import kotlin.math.min @@ -100,10 +92,12 @@ class Legend() : ComponentBase() { * sets the horizontal alignment of the legend */ var horizontalAlignment: LegendHorizontalAlignment = LegendHorizontalAlignment.LEFT + /** * sets the vertical alignment of the legend */ var verticalAlignment: LegendVerticalAlignment = LegendVerticalAlignment.BOTTOM + /** * sets the orientation of the legend */ diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/BarDataSet.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/BarDataSet.kt index 3e02c9bde..7d7505e19 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/BarDataSet.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/BarDataSet.kt @@ -3,11 +3,6 @@ package info.appdev.charting.data import android.graphics.Color import info.appdev.charting.interfaces.datasets.IBarDataSet import info.appdev.charting.utils.Fill -import kotlin.Boolean -import kotlin.Deprecated -import kotlin.Int -import kotlin.String -import kotlin.let open class BarDataSet(yVals: MutableList, label: String) : BarLineScatterCandleBubbleDataSet(yVals, label), IBarDataSet { /** diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/ChartData.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/ChartData.kt index 9cb88c0b1..b025e411c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/ChartData.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/ChartData.kt @@ -480,7 +480,7 @@ abstract class ChartData> : Serializable { */ val colors: IntArray? get() { - val colorArray : IntArray? = null + val colorArray: IntArray? = null dataSets?.let { var clrCount = 0 @@ -595,7 +595,7 @@ abstract class ChartData> : Serializable { /** * Enables / disables highlighting values for all DataSets this data object * contains. If set to true, this means that values can be highlighted programmatically or by touch gesture. - */ + */ var isHighlightEnabled: Boolean get() { for (set in this.dataSets!!) { diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/CombinedData.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/CombinedData.kt index 8f437861e..149ed1a4c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/CombinedData.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/CombinedData.kt @@ -4,9 +4,6 @@ import info.appdev.charting.components.YAxis import info.appdev.charting.highlight.Highlight import info.appdev.charting.interfaces.datasets.IBarLineScatterCandleBubbleDataSet import timber.log.Timber -import kotlin.Boolean -import kotlin.Deprecated -import kotlin.Int /** * Data object that allows the combination of Line-, Bar-, Scatter-, Bubble- and diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/DataSet.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/DataSet.kt index 1f3773808..8da5ca29c 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/DataSet.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/DataSet.kt @@ -2,10 +2,6 @@ package info.appdev.charting.data import timber.log.Timber import java.io.Serializable -import kotlin.Boolean -import kotlin.Deprecated -import kotlin.Int -import kotlin.String import kotlin.math.abs /** diff --git a/chartLib/src/main/kotlin/info/appdev/charting/data/LineScatterCandleRadarDataSet.kt b/chartLib/src/main/kotlin/info/appdev/charting/data/LineScatterCandleRadarDataSet.kt index 57302e1d6..0fa003ffd 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/data/LineScatterCandleRadarDataSet.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/data/LineScatterCandleRadarDataSet.kt @@ -81,7 +81,7 @@ abstract class LineScatterCandleRadarDataSet(yVals: MutableList?, * Returns true if the dashed-line effect is enabled for highlight lines, false if not. * Default: disabled */ - get() = if (this.dashPathEffectHighlight == null) false else true + get() = this.dashPathEffectHighlight != null protected fun copy(lineScatterCandleRadarDataSet: LineScatterCandleRadarDataSet<*>) { super.copy((lineScatterCandleRadarDataSet as BaseDataSet<*>?)!!) diff --git a/chartLib/src/main/kotlin/info/appdev/charting/highlight/CombinedHighlighter.kt b/chartLib/src/main/kotlin/info/appdev/charting/highlight/CombinedHighlighter.kt index 5c825cba5..743757b76 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/highlight/CombinedHighlighter.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/highlight/CombinedHighlighter.kt @@ -6,7 +6,8 @@ import info.appdev.charting.data.DataSet import info.appdev.charting.interfaces.dataprovider.BarDataProvider import info.appdev.charting.interfaces.dataprovider.CombinedDataProvider -open class CombinedHighlighter(combinedDataProvider: CombinedDataProvider, barDataProvider: BarDataProvider) : ChartHighlighter(combinedDataProvider), IHighlighter { +open class CombinedHighlighter(combinedDataProvider: CombinedDataProvider, barDataProvider: BarDataProvider) : + ChartHighlighter(combinedDataProvider), IHighlighter { /** * bar highlighter for supporting stacked highlighting */ diff --git a/chartLib/src/main/kotlin/info/appdev/charting/interfaces/datasets/IDataSet.kt b/chartLib/src/main/kotlin/info/appdev/charting/interfaces/datasets/IDataSet.kt index 551b94013..9a8486453 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/interfaces/datasets/IDataSet.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/interfaces/datasets/IDataSet.kt @@ -229,6 +229,7 @@ interface IDataSet { * Sets the color the value-labels of this DataSet should have. */ var valueTextColor: Int + // This getter is necessary because of the parameter value fun getValueTextColor(value: Int): Int 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 bf066a776..0a1b5c2c3 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/renderer/RadarChartRenderer.kt @@ -13,8 +13,8 @@ import info.appdev.charting.utils.ColorTemplate import info.appdev.charting.utils.PointF import info.appdev.charting.utils.ViewPortHandler import info.appdev.charting.utils.convertDpToPixel -import info.appdev.charting.utils.getPosition import info.appdev.charting.utils.drawImage +import info.appdev.charting.utils.getPosition open class RadarChartRenderer( protected var chart: RadarChart, diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/AssetManagerUtils.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/AssetManagerUtils.kt index 1e19fa79f..b0f56d114 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/AssetManagerUtils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/AssetManagerUtils.kt @@ -1,7 +1,6 @@ package info.appdev.charting.utils import android.content.res.AssetManager -import android.webkit.ConsoleMessage import info.appdev.charting.data.BarEntry import info.appdev.charting.data.Entry import timber.log.Timber diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/ContextUtils.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/ContextUtils.kt index 555c0b7b2..060a84102 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/ContextUtils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/ContextUtils.kt @@ -4,7 +4,6 @@ import android.content.Context import android.os.Build import android.util.DisplayMetrics import android.view.ViewConfiguration -import kotlin.Float var metrics: DisplayMetrics? = null var minimumFlingVelocity = 0 diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/EntryXComparator.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/EntryXComparator.kt index d5bb3a2f7..d380b4deb 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/EntryXComparator.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/EntryXComparator.kt @@ -1,8 +1,6 @@ package info.appdev.charting.utils import info.appdev.charting.data.Entry -import kotlin.Comparator -import kotlin.Int /** * Comparator for comparing Entry-objects by their x-value. diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/FSize.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/FSize.kt index 625943544..7cbfef20d 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/FSize.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/FSize.kt @@ -1,10 +1,6 @@ package info.appdev.charting.utils import info.appdev.charting.utils.ObjectPool.Poolable -import kotlin.Any -import kotlin.Boolean -import kotlin.Int -import kotlin.String /** * Class for describing width and height dimensions in some arbitrary diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/NumberUtils.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/NumberUtils.kt index 920a7d953..3eeaaa1ae 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/NumberUtils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/NumberUtils.kt @@ -1,14 +1,6 @@ package info.appdev.charting.utils import timber.log.Timber -import kotlin.Boolean -import kotlin.Char -import kotlin.CharArray -import kotlin.Float -import kotlin.Int -import kotlin.String -import kotlin.code -import kotlin.isInfinite import kotlin.math.ceil import kotlin.math.log10 import kotlin.math.pow diff --git a/chartLib/src/main/kotlin/info/appdev/charting/utils/SaveUtils.kt b/chartLib/src/main/kotlin/info/appdev/charting/utils/SaveUtils.kt index bd6560e78..7c3a24aea 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/SaveUtils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/SaveUtils.kt @@ -52,7 +52,15 @@ object SaveUtils { * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ - fun saveToGallery(fileName: String, subFolderPath: String?, fileDescription: String?, format: CompressFormat, quality: Int, chartBitmap: Bitmap, context: Context): Boolean { + fun saveToGallery( + fileName: String, + subFolderPath: String?, + fileDescription: String?, + format: CompressFormat, + quality: Int, + chartBitmap: Bitmap, + context: Context + ): Boolean { // restrain quality var fileName = fileName var quality = quality 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 7498f26fc..e43e58582 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/Transformer.kt @@ -9,9 +9,6 @@ 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.PointD.Companion.getInstance -import kotlin.Boolean -import kotlin.FloatArray -import kotlin.Int /** * Transformer class that contains all matrices and is responsible for 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 89b40ea96..b9a2b0e00 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/utils/Utils.kt @@ -7,10 +7,6 @@ import android.view.VelocityTracker import android.view.ViewConfiguration import info.appdev.charting.formatter.DefaultValueFormatter import info.appdev.charting.formatter.IValueFormatter -import kotlin.Int -import kotlin.IntArray -import kotlin.Suppress -import kotlin.intArrayOf import kotlin.math.abs import kotlin.math.cos import kotlin.math.sin