mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
[Agenda] Add showing teachers absence time
This commit is contained in:
parent
2c4e0e3121
commit
d7b2369a32
@ -30,9 +30,17 @@ class TeacherAbsenceAdapter(
|
|||||||
val teacherAbsence: TeacherAbsenceFull = teacherAbsenceList[position]
|
val teacherAbsence: TeacherAbsenceFull = teacherAbsenceList[position]
|
||||||
|
|
||||||
holder.teacherAbsenceTeacher.text = teacherAbsence.teacherFullName
|
holder.teacherAbsenceTeacher.text = teacherAbsence.teacherFullName
|
||||||
|
|
||||||
|
val time = when(teacherAbsence.dateFrom.compareTo(teacherAbsence.dateTo)) {
|
||||||
|
0 -> teacherAbsence.dateFrom.formattedStringShort
|
||||||
|
else -> teacherAbsence.dateFrom.formattedStringShort + " - " + teacherAbsence.dateTo.formattedStringShort
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.teacherAbsenceTime.text = time
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||||
var teacherAbsenceTeacher: TextView = itemView.findViewById(R.id.teacherAbsenceTeacher)
|
var teacherAbsenceTeacher: TextView = itemView.findViewById(R.id.teacherAbsenceTeacher)
|
||||||
|
var teacherAbsenceTime: TextView = itemView.findViewById(R.id.teacherAbsenceTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,16 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_rounded_8dp_outline"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/teacherAbsenceTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
|
tools:text="2 września - 5 kwietnia"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/teacherAbsenceTeacher"
|
android:id="@+id/teacherAbsenceTeacher"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user