From d44a1dbce1da3b4248002f410b2ce881641f4e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Sun, 15 Jul 2018 15:15:19 +0200 Subject: [PATCH] Add weight on grades list (#145) --- .../ui/main/grades/GradesSubItem.java | 6 +++++- app/src/main/res/layout/grades_dialog.xml | 2 +- app/src/main/res/layout/grades_subitem.xml | 18 +++++++++++++++--- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/main/grades/GradesSubItem.java b/app/src/main/java/io/github/wulkanowy/ui/main/grades/GradesSubItem.java index 82b338aed..ee9950406 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/main/grades/GradesSubItem.java +++ b/app/src/main/java/io/github/wulkanowy/ui/main/grades/GradesSubItem.java @@ -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()) { diff --git a/app/src/main/res/layout/grades_dialog.xml b/app/src/main/res/layout/grades_dialog.xml index aceec78fe..932c895ea 100644 --- a/app/src/main/res/layout/grades_dialog.xml +++ b/app/src/main/res/layout/grades_dialog.xml @@ -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" /> @@ -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" /> + + - \ No newline at end of file + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index d6f4cc7d9..55eb2865c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -46,7 +46,7 @@ W obawie o bezpieczeństwo przechowywanych danych osobistych na urządzeniu z podwyższonymi uprawnieniami (root), aplikacja Wulkanowy została zablokowana Opis - Waga + Waga Brak opisu Nauczyciel Data diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32c1efa82..e2a06e972 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -46,7 +46,7 @@ For the sake of safety of personal data stored on a device with increased authorization (root), the Wulkanowy application has been blocked. Description - Weight + Weight No description Teacher Date