forked from github/wulkanowy-mirror
Change text when there are no lessons today and tomorrow in dashboard (#1571)
This commit is contained in:
parent
2ab0a57a41
commit
4e69cfe23c
@ -301,26 +301,31 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
dateToNavigate = currentDate
|
||||
updateLessonView(item, currentTimetable, binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = false
|
||||
binding.dashboardLessonsItemTitleTodayAndTomorrow.isVisible = false
|
||||
}
|
||||
tomorrowTimetable.isNotEmpty() -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
updateLessonView(item, tomorrowTimetable, binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = true
|
||||
binding.dashboardLessonsItemTitleTodayAndTomorrow.isVisible = false
|
||||
}
|
||||
currentDayHeader != null && currentDayHeader.content.isNotBlank() -> {
|
||||
dateToNavigate = currentDate
|
||||
updateLessonView(item, emptyList(), binding, currentDayHeader)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = false
|
||||
binding.dashboardLessonsItemTitleTodayAndTomorrow.isVisible = false
|
||||
}
|
||||
tomorrowDayHeader != null && tomorrowDayHeader.content.isNotBlank() -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
updateLessonView(item, emptyList(), binding, tomorrowDayHeader)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = true
|
||||
binding.dashboardLessonsItemTitleTodayAndTomorrow.isVisible = false
|
||||
}
|
||||
else -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
dateToNavigate = currentDate
|
||||
updateLessonView(item, emptyList(), binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible =
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = false
|
||||
binding.dashboardLessonsItemTitleTodayAndTomorrow.isVisible =
|
||||
!(item.isLoading && item.error == null)
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,19 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/dashboard_lessons_item_title"
|
||||
app:layout_constraintStart_toEndOf="@id/dashboard_lessons_item_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dashboard_lessons_item_title_today_and_tomorrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/dashboard_timetable_title_today_and_tomorrow"
|
||||
android:textColor="?colorOnSurface"
|
||||
android:textSize="14sp"
|
||||
tools:visibility="invisible"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/dashboard_lessons_item_title"
|
||||
app:layout_constraintBottom_toBottomOf="@id/dashboard_lessons_item_title"
|
||||
app:layout_constraintStart_toEndOf="@id/dashboard_lessons_item_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dashboard_lessons_item_first_title"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -504,6 +504,7 @@
|
||||
<!--Dashboard-->
|
||||
<string name="dashboard_timetable_title">Lessons</string>
|
||||
<string name="dashboard_timetable_title_tomorrow">(Tomorrow)</string>
|
||||
<string name="dashboard_timetable_title_today_and_tomorrow">(Today and tomorrow)</string>
|
||||
<string name="dashboard_timetable_first_lesson_title_moment">In a moment:</string>
|
||||
<string name="dashboard_timetable_first_lesson_title_soon">Soon:</string>
|
||||
<string name="dashboard_timetable_first_lesson_title_first">First:</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user