From 1f2b0329c51bb55ae68b62abc1cef7756e579054 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Tue, 21 Jul 2015 21:24:35 +0200 Subject: [PATCH] Misc improvelets (#45) --- .../gadgetbridge/activities/ChartsActivity.java | 1 - .../gadgetbridge/activities/SleepChartFragment.java | 3 ++- .../gadgetbridge/charts/CustomLegendRenderer.java | 4 ++++ app/src/main/res/menu/menu_charts.xml | 2 ++ app/src/main/res/values/strings.xml | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ChartsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ChartsActivity.java index 28e9ca5ff..718fd69bd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ChartsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ChartsActivity.java @@ -76,7 +76,6 @@ public class ChartsActivity extends FragmentActivity { boolean wasBusy = mProgressBar.getVisibility() != View.GONE; if (wasBusy) { mProgressBar.setVisibility(View.GONE); - // TODO: refresh current fragment LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(AbstractChartFragment.ACTION_REFRESH)); } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SleepChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SleepChartFragment.java index 643f880a8..62d31c68d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SleepChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SleepChartFragment.java @@ -104,7 +104,8 @@ public class SleepChartFragment extends AbstractChartFragment { data.setDataSet(set); pieChart.setData(data); - setupLegend(pieChart); + pieChart.getLegend().setEnabled(false); + //setupLegend(pieChart); pieChart.invalidate(); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/charts/CustomLegendRenderer.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/charts/CustomLegendRenderer.java index 86bb2246f..812cb2a05 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/charts/CustomLegendRenderer.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/charts/CustomLegendRenderer.java @@ -21,6 +21,10 @@ public class CustomLegendRenderer extends LegendRenderer { @Override public void computeLegend(ChartData data) { + if (!mLegend.isEnabled()) { + return; + } + // don't call super to avoid computing colors and labels // super.computeLegend(data); diff --git a/app/src/main/res/menu/menu_charts.xml b/app/src/main/res/menu/menu_charts.xml index 8200a7fc5..9d82ca859 100644 --- a/app/src/main/res/menu/menu_charts.xml +++ b/app/src/main/res/menu/menu_charts.xml @@ -7,6 +7,8 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 950f89e06..233112474 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,7 +6,7 @@ Settings Debug Quit - Fetch Activity Data + Synchronize Sleep Monitor (ALPHA) Find Deviceā€¦ Take Screenshot @@ -137,7 +137,7 @@ Incoming Call Notification Find lost Device Cancel to stop vibration. - ChartsActivity + Your Activity Configure Alarms Configure alarms Alarm Details