Add weight on grades list (#145)

This commit is contained in:
Mikołaj Pich 2018-07-15 15:15:19 +02:00 committed by Rafał Borcz
parent 083765b020
commit d44a1dbce1
5 changed files with 23 additions and 7 deletions

View File

@ -88,6 +88,9 @@ public class GradesSubItem
@BindView(R.id.grade_subitem_date)
TextView date;
@BindView(R.id.grade_subitem_weight)
TextView weight;
@BindView(R.id.grade_subitem_alert_image)
View alert;
@ -110,8 +113,9 @@ public class GradesSubItem
value.setText(item.getValue());
value.setBackgroundResource(GradeUtils.getValueColor(item.getValue()));
date.setText(item.getDate());
description.setText(getDescriptionString());
date.setText(item.getDate());
weight.setText(String.format("%s: %s", context.getResources().getString(R.string.grade_weight_text), item.getWeight()));
alert.setVisibility(item.getRead() ? View.INVISIBLE : View.VISIBLE);
if (!item.getRead()) {

View File

@ -83,7 +83,7 @@
android:layout_alignParentStart="true"
android:layout_below="@+id/grade_dialog_description_value"
android:layout_marginTop="10dp"
android:text="@string/dialog_weight_text"
android:text="@string/grade_weight_text"
android:textSize="17sp" />
<TextView

View File

@ -48,7 +48,7 @@
android:layout_toRightOf="@+id/grade_subitem_value"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_name"
android:text="@string/dialog_description_text"
android:textSize="15sp"
tool:ignore="all" />
@ -59,7 +59,19 @@
android:layout_alignBottom="@+id/grade_subitem_value"
android:layout_alignLeft="@+id/grade_subitem_description"
android:layout_alignStart="@+id/grade_subitem_description"
android:text="@string/grades_text"
android:text="@string/dialog_date_text"
android:textSize="12sp" />
<TextView
android:id="@+id/grade_subitem_weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/grade_subitem_date"
android:layout_toRightOf="@+id/grade_subitem_date"
android:layout_alignBottom="@+id/grade_subitem_value"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:text="@string/grade_weight_text"
android:textSize="12sp" />
<ImageView
@ -73,4 +85,4 @@
tool:ignore="contentDescription" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.v7.widget.CardView>

View File

@ -46,7 +46,7 @@
<string name="alert_dialog_blocked_app_message">W obawie o bezpieczeństwo przechowywanych danych osobistych na urządzeniu z podwyższonymi uprawnieniami (root), aplikacja Wulkanowy została zablokowana</string>
<string name="dialog_description_text">Opis</string>
<string name="dialog_weight_text">Waga</string>
<string name="grade_weight_text">Waga</string>
<string name="noDescription_text">Brak opisu</string>
<string name="dialog_teacher_text">Nauczyciel</string>
<string name="dialog_date_text">Data</string>

View File

@ -46,7 +46,7 @@
<string name="alert_dialog_blocked_app_message">For the sake of safety of personal data stored on a device with increased authorization (root), the Wulkanowy application has been blocked.</string>
<string name="dialog_description_text">Description</string>
<string name="dialog_weight_text">Weight</string>
<string name="grade_weight_text">Weight</string>
<string name="noDescription_text">No description</string>
<string name="dialog_teacher_text">Teacher</string>
<string name="dialog_date_text">Date</string>