From ffdc923268b62d4bfdeff22fcf96049782d038ce Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Tue, 15 Mar 2016 06:06:15 -0400 Subject: [PATCH] Make labels more clear and customizable --- .../isoron/uhabits/views/RepetitionCountView.java | 7 +++++++ app/src/main/res/layout/show_habit.xml | 13 ++++++++----- app/src/main/res/values/strings.xml | 9 +++++---- app/src/main/res/values/styles.xml | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/views/RepetitionCountView.java b/app/src/main/java/org/isoron/uhabits/views/RepetitionCountView.java index f99a2221a..38b2aab61 100644 --- a/app/src/main/java/org/isoron/uhabits/views/RepetitionCountView.java +++ b/app/src/main/java/org/isoron/uhabits/views/RepetitionCountView.java @@ -38,6 +38,13 @@ public class RepetitionCountView extends NumberView implements HabitDataView { super(context, attrs); this.interval = DialogHelper.getIntAttribute(context, attrs, "interval"); + + int labelValue = DialogHelper.getIntAttribute(context, attrs, "labelValue"); + String labelFormat = DialogHelper.getAttribute(context, attrs, "labelFormat"); + + if(labelValue > 0) + setLabel(String.format(labelFormat, labelValue)); + refreshData(); } diff --git a/app/src/main/res/layout/show_habit.xml b/app/src/main/res/layout/show_habit.xml index 83eae1e52..c1e88dba1 100644 --- a/app/src/main/res/layout/show_habit.xml +++ b/app/src/main/res/layout/show_habit.xml @@ -65,7 +65,7 @@ + android:text="@string/number_of_repetitions"/> Frequency Checkmark - Repetitions - Month - Year - Quarter + Number of repetitions + Last %d days + Last %d weeks + Last %d months + Last %d years All time \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index f897ed590..d44beb972 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -63,7 +63,7 @@