Make labels more clear and customizable

pull/69/head
Alinson S. Xavier 10 years ago
parent 9232378d04
commit ffdc923268

@ -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();
}

@ -65,7 +65,7 @@
<TextView
android:id="@+id/tvCount"
style="@style/cardHeaderStyle"
android:text="@string/repetitions"/>
android:text="@string/number_of_repetitions"/>
<LinearLayout
android:id="@+id/llRepetition"
@ -76,20 +76,23 @@
<org.isoron.uhabits.views.RepetitionCountView
style="@style/smallDataViewStyle"
app:interval="31"
app:label="@string/month"
app:interval="30"
app:labelValue="30"
app:labelFormat="@string/last_x_days"
app:textSize="12"/>
<org.isoron.uhabits.views.RepetitionCountView
style="@style/smallDataViewStyle"
app:interval="92"
app:label="@string/quarter"
app:labelValue="4"
app:labelFormat="@string/last_x_months"
app:textSize="12"/>
<org.isoron.uhabits.views.RepetitionCountView
style="@style/smallDataViewStyle"
app:interval="365"
app:label="@string/year"
app:labelValue="12"
app:labelFormat="@string/last_x_months"
app:textSize="12"/>
<org.isoron.uhabits.views.RepetitionCountView

@ -125,9 +125,10 @@
<string name="frequency">Frequency</string>
<string name="checkmark">Checkmark</string>
<string name="repetitions">Repetitions</string>
<string name="month">Month</string>
<string name="year">Year</string>
<string name="quarter">Quarter</string>
<string name="number_of_repetitions">Number of repetitions</string>
<string name="last_x_days">Last %d days</string>
<string name="last_x_weeks">Last %d weeks</string>
<string name="last_x_months">Last %d months</string>
<string name="last_x_years">Last %d years</string>
<string name="all_time">All time</string>
</resources>

@ -63,7 +63,7 @@
<style name="cardHeaderStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:layout_marginBottom">12dp</item>
<item name="android:textSize">16sp</item>
<item name="android:textStyle">bold</item>
</style>

Loading…
Cancel
Save