Skip to content

Commit cb34e08

Browse files
author
alllexey
committed
Add 'Updating' lesson list widget item
1 parent 3d80b75 commit cb34e08

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

app/src/main/java/me/alllexey123/itmowidgets/ui/widgets/data/LessonListRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package me.alllexey123.itmowidgets.ui.widgets.data
33
object LessonListDataHolder {
44
@Volatile
55
private var data: LessonListWidgetData = LessonListWidgetData(
6-
listOf(LessonListWidgetEntry.LessonListEnd)
6+
listOf(LessonListWidgetEntry.Updating)
77
)
88

99
fun setData(newData: LessonListWidgetData) {

app/src/main/java/me/alllexey123/itmowidgets/ui/widgets/data/LessonListWidgetEntry.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sealed class LessonListWidgetEntry(open val layoutId: Int) {
77
object FullDayEmpty : LessonListWidgetEntry(R.layout.item_lesson_list_empty)
88
object NoMoreLessons : LessonListWidgetEntry(R.layout.item_lesson_list_no_more)
99
object LessonListEnd : LessonListWidgetEntry(R.layout.item_lesson_list_end)
10+
object Updating : LessonListWidgetEntry(R.layout.item_lesson_list_updating)
1011

1112
// null to hide
1213
data class LessonData(
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="wrap_content"
5+
android:id="@+id/item_root">
6+
7+
<TextView
8+
android:id="@+id/empty_view"
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:gravity="center"
12+
android:padding="16dp"
13+
android:text="Обновление данных..."
14+
android:textAppearance="?android:attr/textAppearanceMedium"
15+
android:textColor="?attr/colorOnSurface" />
16+
17+
</LinearLayout>

0 commit comments

Comments
 (0)