mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Make labels more clear and customizable
This commit is contained in:
@@ -38,6 +38,13 @@ public class RepetitionCountView extends NumberView implements HabitDataView
|
|||||||
{
|
{
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
this.interval = DialogHelper.getIntAttribute(context, attrs, "interval");
|
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();
|
refreshData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvCount"
|
android:id="@+id/tvCount"
|
||||||
style="@style/cardHeaderStyle"
|
style="@style/cardHeaderStyle"
|
||||||
android:text="@string/repetitions"/>
|
android:text="@string/number_of_repetitions"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/llRepetition"
|
android:id="@+id/llRepetition"
|
||||||
@@ -76,20 +76,23 @@
|
|||||||
|
|
||||||
<org.isoron.uhabits.views.RepetitionCountView
|
<org.isoron.uhabits.views.RepetitionCountView
|
||||||
style="@style/smallDataViewStyle"
|
style="@style/smallDataViewStyle"
|
||||||
app:interval="31"
|
app:interval="30"
|
||||||
app:label="@string/month"
|
app:labelValue="30"
|
||||||
|
app:labelFormat="@string/last_x_days"
|
||||||
app:textSize="12"/>
|
app:textSize="12"/>
|
||||||
|
|
||||||
<org.isoron.uhabits.views.RepetitionCountView
|
<org.isoron.uhabits.views.RepetitionCountView
|
||||||
style="@style/smallDataViewStyle"
|
style="@style/smallDataViewStyle"
|
||||||
app:interval="92"
|
app:interval="92"
|
||||||
app:label="@string/quarter"
|
app:labelValue="4"
|
||||||
|
app:labelFormat="@string/last_x_months"
|
||||||
app:textSize="12"/>
|
app:textSize="12"/>
|
||||||
|
|
||||||
<org.isoron.uhabits.views.RepetitionCountView
|
<org.isoron.uhabits.views.RepetitionCountView
|
||||||
style="@style/smallDataViewStyle"
|
style="@style/smallDataViewStyle"
|
||||||
app:interval="365"
|
app:interval="365"
|
||||||
app:label="@string/year"
|
app:labelValue="12"
|
||||||
|
app:labelFormat="@string/last_x_months"
|
||||||
app:textSize="12"/>
|
app:textSize="12"/>
|
||||||
|
|
||||||
<org.isoron.uhabits.views.RepetitionCountView
|
<org.isoron.uhabits.views.RepetitionCountView
|
||||||
|
|||||||
@@ -125,9 +125,10 @@
|
|||||||
<string name="frequency">Frequency</string>
|
<string name="frequency">Frequency</string>
|
||||||
<string name="checkmark">Checkmark</string>
|
<string name="checkmark">Checkmark</string>
|
||||||
|
|
||||||
<string name="repetitions">Repetitions</string>
|
<string name="number_of_repetitions">Number of repetitions</string>
|
||||||
<string name="month">Month</string>
|
<string name="last_x_days">Last %d days</string>
|
||||||
<string name="year">Year</string>
|
<string name="last_x_weeks">Last %d weeks</string>
|
||||||
<string name="quarter">Quarter</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>
|
<string name="all_time">All time</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<style name="cardHeaderStyle">
|
<style name="cardHeaderStyle">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</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:textSize">16sp</item>
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user