diff --git a/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt b/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt index 3d8ea2b..c5fead4 100644 --- a/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt +++ b/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt @@ -54,6 +54,7 @@ class MainExample : AppCompatActivity() { forecastedLine.color, forecastedLine.forecasted) endDateBar(endDateBar.x, endDateBar.y) unit("m³") + detailsEnable(true) } } } diff --git a/core/src/main/java/com/oxeanbits/forecastchart/core/ui/component/ForecastChartComponent.kt b/core/src/main/java/com/oxeanbits/forecastchart/core/ui/component/ForecastChartComponent.kt index c6acf38..c0beaec 100644 --- a/core/src/main/java/com/oxeanbits/forecastchart/core/ui/component/ForecastChartComponent.kt +++ b/core/src/main/java/com/oxeanbits/forecastchart/core/ui/component/ForecastChartComponent.kt @@ -36,6 +36,7 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re private var endDateData: BarEntry = emptyBar() private var unit: String = "" private var zoomEnabled: Boolean = false + private var detailsEnable: Boolean = false public override fun onAttachedToWindow() { super.onAttachedToWindow() @@ -52,7 +53,9 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re size(MATCH, MATCH) orientation(VERTICAL) - renderDetailsLayout() + if(detailsEnable) { + renderDetailsLayout() + } renderChart() } } @@ -183,4 +186,8 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re fun zoomEnabled(zoomEnabled: Boolean){ this.zoomEnabled = zoomEnabled } + + fun detailsEnable(detailsEnable: Boolean){ + this.detailsEnable = detailsEnable + } } \ No newline at end of file diff --git a/core/src/main/java/com/oxeanbits/forecastchart/core/util/SetupChart.kt b/core/src/main/java/com/oxeanbits/forecastchart/core/util/SetupChart.kt index 646d969..1144405 100644 --- a/core/src/main/java/com/oxeanbits/forecastchart/core/util/SetupChart.kt +++ b/core/src/main/java/com/oxeanbits/forecastchart/core/util/SetupChart.kt @@ -73,9 +73,5 @@ object SetupChart{ combinedChart.marker = marker combinedChart.extraLeftOffset = SIDE_OFFSET combinedChart.extraRightOffset = SIDE_OFFSET - - combinedChart.setOnClickListener { - combinedChart.highlightValue(null) - } } } \ No newline at end of file