Change grade header note to unread count (#634)

This commit is contained in:
Dominik Korsa 2020-01-04 01:46:43 +01:00 committed by Rafał Borcz
parent b9378c24b5
commit f204264d2d
3 changed files with 17 additions and 6 deletions

View File

@ -38,6 +38,7 @@ class GradeDetailsHeader(
gradeHeaderAverage.text = average gradeHeaderAverage.text = average
gradeHeaderNumber.text = number gradeHeaderNumber.text = number
gradeHeaderNote.visibility = if (newGrades > 0) VISIBLE else GONE gradeHeaderNote.visibility = if (newGrades > 0) VISIBLE else GONE
if (newGrades > 0) gradeHeaderNote.text = newGrades.toString(10)
gradeHeaderContainer.isEnabled = isExpandable gradeHeaderContainer.isEnabled = isExpandable
isViewExpandable = isExpandable isViewExpandable = isExpandable

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="?colorPrimary"/>
<corners android:radius="12dp"/>
</shape>

View File

@ -7,7 +7,7 @@
android:background="?selectableItemBackground" android:background="?selectableItemBackground"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="12dp" android:paddingRight="14dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
tools:context=".ui.modules.grade.details.GradeDetailsHeader" tools:context=".ui.modules.grade.details.GradeDetailsHeader"
android:paddingEnd="12dp" android:paddingEnd="12dp"
@ -50,14 +50,19 @@
android:textSize="12sp" android:textSize="12sp"
tools:text="12 grades" /> tools:text="12 grades" />
<ImageView <TextView
android:id="@+id/gradeHeaderNote" android:id="@+id/gradeHeaderNote"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:minWidth="20dp"
android:layout_height="20dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="center"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
app:srcCompat="@drawable/ic_all_round_mark" android:background="@drawable/background_header_note"
app:tint="?colorPrimary" android:textColor="?colorOnPrimary"
tools:ignore="contentDescription" /> android:textSize="14sp"
tools:text="255" />
</RelativeLayout> </RelativeLayout>