Commit af89c076 authored by Joey's avatar Joey

app: overview: update for MPChart API changes

Signed-off-by: Joey's avatarJoey <bevilacquajoey@gmail.com>
Change-Id: Iaa63cc45ae824314d17513a055219a7b2225f738
parent bd747857
......@@ -26,16 +26,16 @@ import androidx.lifecycle.ViewModelProviders
import com.github.mikephil.charting.data.Entry
import com.github.mikephil.charting.data.LineData
import com.github.mikephil.charting.data.LineDataSet
import com.github.mikephil.charting.formatter.IValueFormatter
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet
import it.diab.R
import it.diab.data.entities.Glucose
import it.diab.data.repositories.GlucoseRepository
import it.diab.core.override.BaseFitHandler
import it.diab.core.util.Activities
import it.diab.core.util.SystemUtil
import it.diab.core.util.intentTo
import it.diab.data.entities.Glucose
import it.diab.data.repositories.GlucoseRepository
import it.diab.ui.graph.OverviewGraphView
import it.diab.ui.graph.OverviewValueFormatter
import it.diab.util.extensions.isToday
import it.diab.viewmodels.overview.OverviewViewModel
import it.diab.viewmodels.overview.OverviewViewModelFactory
......@@ -196,7 +196,7 @@ class OverviewFragment : BaseFragment() {
lineWidth = resources.getDimension(R.dimen.overview_graph_line_thickness)
valueTextSize = resources.getDimension(R.dimen.overview_graph_text)
valueTextColor = textColor
valueFormatter = IValueFormatter { value, _, _, _ -> "%.0f".format(value) }
valueFormatter = OverviewValueFormatter()
mode = LineDataSet.Mode.CUBIC_BEZIER
}
}
......
/*
* Copyright (c) 2019 Bevilacqua Joey
*
* Licensed under the GNU GPLv3 license
*
* The text of the license can be found in the LICENSE file
* or at https://www.gnu.org/licenses/gpl.txt
*/
package it.diab.ui.graph
import com.github.mikephil.charting.formatter.ValueFormatter
class OverviewValueFormatter : ValueFormatter() {
override fun getFormattedValue(value: Float): String {
return "%.0f".format(value)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment