Updated schedule meeting layout

This commit is contained in:
Sylvain Berfini 2024-02-13 14:19:49 +01:00
parent 9872f505b6
commit 109b5e71e2
2 changed files with 43 additions and 55 deletions

View file

@ -364,7 +364,9 @@ class ScheduleMeetingViewModel @UiThread constructor() : ViewModel() {
@UiThread
fun schedule() {
if (subject.value.orEmpty().isEmpty() || participants.value.orEmpty().isEmpty()) {
Log.e("$TAG Either no subject was set or no participant was selected, can't schedule meeting.")
Log.e(
"$TAG Either no subject was set or no participant was selected, can't schedule meeting."
)
// TODO: show red toast
return
}

View file

@ -247,96 +247,82 @@
app:layout_constraintTop_toBottomOf="@id/subject"
android:background="?attr/color_main2_200" />
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/all_day_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:checked="@={viewModel.allDayMeeting}"
app:layout_constraintStart_toEndOf="@id/all_day"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/separator"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_700"
android:id="@+id/all_day"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/meeting_schedule_date_all_day_title"
android:textColor="?attr/color_main2_600"
android:textSize="14sp"
android:drawableStart="@drawable/clock"
android:drawablePadding="8dp"
android:drawableTint="?attr/color_main2_600"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/all_day_switch"
app:layout_constraintTop_toTopOf="@id/all_day_switch"
app:layout_constraintBottom_toBottomOf="@id/all_day_switch"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/from_date"
android:onClick="@{pickStartDateClickListener}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@{viewModel.fromDate, default=`Tue. October 10th, 2023`}"
android:textSize="14sp"
android:textColor="?attr/color_main2_600"
app:layout_constraintStart_toStartOf="@id/all_day"
app:layout_constraintTop_toBottomOf="@id/all_day_switch" />
android:drawableStart="@drawable/clock"
android:drawablePadding="8dp"
android:drawableTint="?attr/color_main2_600"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/separator" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
style="@style/default_text_style_700"
android:id="@+id/from_time"
android:onClick="@{pickStartTimeClickListener}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="10dp"
android:text="@{viewModel.fromTime, default=`17:00`}"
android:textSize="14sp"
android:textColor="?attr/color_main2_600"
android:visibility="@{viewModel.allDayMeeting ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/all_day_switch"
app:layout_constraintTop_toTopOf="@id/from_date" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/to_date"
android:onClick="@{pickEndDateClickListener}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@{viewModel.toDate, default=`Tue. October 10th, 2023`}"
android:textSize="14sp"
android:textColor="?attr/color_main2_600"
android:visibility="@{viewModel.allDayMeeting ? View.GONE : View.VISIBLE}"
app:layout_constraintStart_toStartOf="@id/from_date"
app:layout_constraintTop_toBottomOf="@id/from_date" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
style="@style/default_text_style_700"
android:id="@+id/to_time"
android:onClick="@{pickEndTimeClickListener}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.toTime, default=`17:00`}"
android:layout_marginStart="45dp"
android:text="@{viewModel.toTime, default=`18:00`}"
android:textSize="14sp"
android:textColor="?attr/color_main2_600"
android:visibility="@{viewModel.allDayMeeting ? View.GONE : View.VISIBLE}"
app:layout_constraintEnd_toEndOf="@id/all_day_switch"
app:layout_constraintTop_toTopOf="@id/to_date" />
app:layout_constraintStart_toEndOf="@id/from_time"
app:layout_constraintTop_toTopOf="@id/from_time" />
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/all_day_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="32dp"
android:checked="@={viewModel.allDayMeeting}"
app:layout_constraintStart_toStartOf="@id/from_date"
app:layout_constraintTop_toBottomOf="@id/from_time"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_500"
android:id="@+id/all_day"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/meeting_schedule_date_all_day_title"
android:textColor="?attr/color_main2_600"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@id/all_day_switch"
app:layout_constraintTop_toTopOf="@id/all_day_switch"
app:layout_constraintBottom_toBottomOf="@id/all_day_switch"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_700"
android:id="@+id/timezone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="26dp"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{viewModel.timezone, default=@string/meeting_schedule_timezone_title}"
@ -349,7 +335,7 @@
android:drawableTint="?attr/color_main2_600"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/to_date" />
app:layout_constraintTop_toBottomOf="@id/all_day_switch" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_700"