Change text when there are no lessons today and tomorrow in dashboard
MODIFY
app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt
app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt
@@ -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)
}
}

MODIFY
app/src/main/res/layout/item_dashboard_lessons.xml
app/src/main/res/layout/item_dashboard_lessons.xml
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"

MODIFY
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
<!--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>

Change text when there are no lessons today and tomorrow in dashboard (#1571)