[APIv2/Timetable] Add showing unread lesson changes

This commit is contained in:
Kacper Ziubryniewicz 2019-11-23 22:26:21 +01:00
parent 6a4994b9c2
commit cd76f99bbf
3 changed files with 27 additions and 1 deletions

View File

@ -247,6 +247,8 @@ class TimetableDayFragment : Fragment(), CoroutineScope {
lb.detailsFirst.text = listOfNotEmpty(timeRange, classroomInfo).concat(bullet)
lb.detailsSecond.text = listOfNotEmpty(teacherInfo, teamInfo).concat(bullet)
lb.unread = lesson.type != Lesson.TYPE_NORMAL && !lesson.seen
//lb.subjectName.typeface = Typeface.create("sans-serif-light", Typeface.BOLD)
when (lesson.type) {
Lesson.TYPE_NORMAL -> {

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) Kacper Ziubryniewicz 2019-11-23
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/red500"/>
<size android:width="10dp" android:height="10dp"/>
</shape>

View File

@ -11,6 +11,9 @@
<variable
name="lessonNumber"
type="Integer" />
<variable
name="unread"
type="boolean" />
</data>
<FrameLayout
android:layout_width="match_parent"
@ -70,6 +73,17 @@
tools:maxLines="2"
tools:text="pracownia urządzeń techniki komputerowej" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:visibility="@{unread ? View.VISIBLE : View.GONE}"
app:srcCompat="@drawable/unread_red_circle" />
<ImageView
android:id="@+id/attendanceIcon"
android:layout_width="24dp"
@ -136,4 +150,4 @@
</LinearLayout>
</FrameLayout>
</layout>
</layout>