[UI/Agenda] Fix teacher absence list truncated

This commit is contained in:
Kuba Szczodrzyński 2019-09-29 21:48:35 +02:00
parent e0a1a9a2ab
commit 9a3ab838b7
2 changed files with 12 additions and 12 deletions

View File

@ -20,7 +20,7 @@ class TeacherAbsenceDialog(val context: Context) {
fun show(app: App, date: Date) {
val dialog = MaterialDialog.Builder(context)
.title(date.formattedString)
.customView(R.layout.dialog_teacher_absence_list, true)
.customView(R.layout.dialog_teacher_absence_list, false)
.positiveText(R.string.close)
.autoDismiss(false)
.onPositive { dialog, _ -> dialog.dismiss()}
@ -29,8 +29,7 @@ class TeacherAbsenceDialog(val context: Context) {
val customView: View = dialog.customView ?: return
b = DataBindingUtil.bind(customView) ?: return
b.teacherAbsenceView.setHasFixedSize(false)
b.teacherAbsenceView.isNestedScrollingEnabled = false
b.teacherAbsenceView.setHasFixedSize(true)
b.teacherAbsenceView.layoutManager = LinearLayoutManager(context)
app.db.teacherAbsenceDao().getAllByDateFull(profileId, date).observe(context as LifecycleOwner, Observer { absenceList ->

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/teacherAbsenceView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/row_dialog_teacher_absence_item" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/teacherAbsenceView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:clipToPadding="false"
tools:listitem="@layout/row_dialog_teacher_absence_item" />
</layout>