[UI/Agenda] Fix event list truncated & update tools preview

This commit is contained in:
Kuba Szczodrzyński 2019-09-29 22:06:51 +02:00
parent d1164c8acd
commit b8304e7441
4 changed files with 42 additions and 42 deletions

View File

@ -86,7 +86,7 @@ public class EventListDialog {
private void actualShow(Date date, Time time, boolean noDefaultTimeWhenAdding) {
dialog = new MaterialDialog.Builder(context)
.title((time == null ? date.getFormattedString() : (lesson != null ? lesson.getSubjectLongName() : date.getFormattedString())+", "+time.getStringHM()))
.customView(R.layout.dialog_event_list, true)
.customView(R.layout.dialog_event_list, false)
.neutralText(R.string.add)
.positiveText(R.string.close)
.autoDismiss(false)
@ -170,7 +170,7 @@ public class EventListDialog {
examsView = dialogView.findViewById(R.id.eventListView);
examsView.setHasFixedSize(false);
examsView.setNestedScrollingEnabled(false);
examsView.setNestedScrollingEnabled(true);
examsView.setLayoutManager(new LinearLayoutManager(context));
CardView lessonChangeContainer = dialogView.findViewById(R.id.lessonChangeContainer);

View File

@ -1,25 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/detailsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/lessonChangeContainer"
layout="@layout/row_lesson_change_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:visibility="gone"
tools:visibility="visible" />
@ -28,7 +29,10 @@
layout="@layout/row_teacher_absence_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:visibility="gone"
tools:visibility="visible" />
@ -36,6 +40,8 @@
android:id="@+id/eventListLessonDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:orientation="vertical">
<TextView
@ -66,34 +72,28 @@
tools:text="029 informatyczna -> 016 językowa" />
</LinearLayout>
<TextView
android:id="@+id/textNoEvents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="32dp"
android:text="@string/dialog_event_list_no_data"
android:textStyle="italic"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/eventListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:clipToPadding="false"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp"
tools:listitem="@layout/row_dialog_event_list_item" />
</LinearLayout>
<TextView
android:id="@+id/textNoEvents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/dialog_event_list_no_data"
android:textStyle="italic"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/detailsLayout" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/eventListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/detailsLayout"
tools:listitem="@layout/row_dialog_event_list_item">
</androidx.recyclerview.widget.RecyclerView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -1,7 +1,7 @@
<androidx.cardview.widget.CardView android:id="@+id/lesson_change_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:cardBackgroundColor="@color/blue_selected"
tools:cardBackgroundColor="#78909c"
app:cardCornerRadius="5dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"

View File

@ -1,7 +1,7 @@
<androidx.cardview.widget.CardView android:id="@+id/teacherAbsenceCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:cardBackgroundColor="@color/blue_selected"
tools:cardBackgroundColor="#ff1744"
app:cardCornerRadius="5dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"