Skip to content

Commit 1fce57b

Browse files
UI: show no videos hint for channels
1 parent e972786 commit 1fce57b

File tree

10 files changed

+59
-5
lines changed

10 files changed

+59
-5
lines changed

android/src/main/kotlin/project/pipepipe/app/ui/screens/ChannelScreen.kt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ fun ChannelScreen(
256256
item.url,
257257
item.serviceId
258258
)
259-
}
259+
},
260+
emptyMessage = stringResource(MR.strings.empty_channel_lives)
260261
)
261262

262263
ChannelTabType.VIDEOS -> TabContent(
@@ -271,7 +272,8 @@ fun ChannelScreen(
271272
item.url,
272273
item.serviceId
273274
)
274-
}
275+
},
276+
emptyMessage = stringResource(MR.strings.empty_channel_videos)
275277
)
276278

277279
ChannelTabType.PLAYLISTS -> TabContent(
@@ -284,7 +286,8 @@ fun ChannelScreen(
284286
onItemClick = { item -> navController.navigate(
285287
"playlist?url=" + URLEncoder.encode(item.url, "UTF-8")
286288
+ if(item.serviceId != null) "&serviceId=${item.serviceId}" else ""
287-
)}
289+
)},
290+
emptyMessage = stringResource(MR.strings.empty_channel_playlists)
288291
)
289292

290293
ChannelTabType.ALBUMS -> TabContent(
@@ -297,7 +300,8 @@ fun ChannelScreen(
297300
onItemClick = { item -> navController.navigate(
298301
"playlist?url=" + URLEncoder.encode(item.url, "UTF-8")
299302
+ if(item.serviceId != null) "&serviceId=${item.serviceId}" else ""
300-
)}
303+
)},
304+
emptyMessage = stringResource(MR.strings.empty_channel_albums)
301305
)
302306

303307
else -> {
@@ -448,7 +452,8 @@ private fun <T: Info> TabContent(
448452
hasMore: Boolean,
449453
onLoadMore: () -> Unit,
450454
getUrl: (T) -> String,
451-
onItemClick: (T) -> Unit
455+
onItemClick: (T) -> Unit,
456+
emptyMessage: String? = null
452457
) {
453458
val uniqueItems = remember(items) { items.distinctBy { getUrl(it) } }
454459
val loadMoreInvoker = rememberUpdatedState(onLoadMore)
@@ -478,6 +483,19 @@ private fun <T: Info> TabContent(
478483
) {
479484
CircularProgressIndicator()
480485
}
486+
} else if (!isLoading && uniqueItems.isEmpty() && emptyMessage != null) {
487+
Box(
488+
modifier = Modifier
489+
.fillMaxSize()
490+
.padding(32.dp),
491+
contentAlignment = Alignment.Center
492+
) {
493+
Text(
494+
text = emptyMessage,
495+
style = MaterialTheme.typography.bodyLarge,
496+
color = supportingTextColor()
497+
)
498+
}
481499
} else {
482500
LazyColumn(
483501
modifier = Modifier

library/src/commonMain/moko-resources/base/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@
398398
<string name="empty_pinned_feed_groups">No pinned feed groups yet</string>
399399
<string name="empty_pinned_playlists">No pinned playlists yet</string>
400400
<string name="empty_history">No watch history yet</string>
401+
<string name="empty_channel_videos">No videos</string>
402+
<string name="empty_channel_lives">No live streams</string>
403+
<string name="empty_channel_playlists">No playlists</string>
404+
<string name="empty_channel_albums">No albums</string>
401405
<string name="subscription_export_json_title">Export subscriptions (JSON)</string>
402406
<string name="subscription_export_json_summary">Export channel subscriptions as JSON file</string>
403407
<string name="subscription_import_json_title">Import subscriptions (JSON)</string>

library/src/commonMain/moko-resources/de/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">Datenmigration</string>
455455
<string name="first_run_dialog_no_thanks">Nein, danke</string>
456456
<string name="welcome_dialog_button">App erkunden</string>
457+
<string name="empty_channel_playlists">Keine Playlists</string>
458+
<string name="empty_channel_albums">Keine Alben</string>
459+
<string name="empty_channel_videos">Keine Videos</string>
460+
<string name="empty_channel_lives">Keine Livestreams</string>
457461
</resources>

library/src/commonMain/moko-resources/es/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">Migración de Datos</string>
455455
<string name="first_run_dialog_no_thanks">No, gracias</string>
456456
<string name="welcome_dialog_button">Explorar la Aplicación</string>
457+
<string name="empty_channel_playlists">No hay listas de reproducción</string>
458+
<string name="empty_channel_albums">No hay álbumes</string>
459+
<string name="empty_channel_videos">No hay videos</string>
460+
<string name="empty_channel_lives">No hay transmisiones en vivo</string>
457461
</resources>

library/src/commonMain/moko-resources/fr/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">Migration des données</string>
455455
<string name="first_run_dialog_no_thanks">Non, merci</string>
456456
<string name="welcome_dialog_button">Explorer l\'application</string>
457+
<string name="empty_channel_playlists">Aucune playlist</string>
458+
<string name="empty_channel_albums">Aucun album</string>
459+
<string name="empty_channel_videos">Aucune vidéo</string>
460+
<string name="empty_channel_lives">Aucun direct</string>
457461
</resources>

library/src/commonMain/moko-resources/it/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">Migrazione Dati</string>
455455
<string name="first_run_dialog_no_thanks">No, grazie</string>
456456
<string name="welcome_dialog_button">Esplora l\'App</string>
457+
<string name="empty_channel_playlists">Nessuna playlist</string>
458+
<string name="empty_channel_albums">Nessun album</string>
459+
<string name="empty_channel_videos">Nessun video</string>
460+
<string name="empty_channel_lives">Nessuna trasmissione in diretta</string>
457461
</resources>

library/src/commonMain/moko-resources/ja/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">データ移行</string>
455455
<string name="first_run_dialog_no_thanks">いいえ、結構です</string>
456456
<string name="welcome_dialog_button">アプリを探索</string>
457+
<string name="empty_channel_playlists">再生リストがありません</string>
458+
<string name="empty_channel_albums">アルバムがありません</string>
459+
<string name="empty_channel_videos">動画がありません</string>
460+
<string name="empty_channel_lives">ライブ配信がありません</string>
457461
</resources>

library/src/commonMain/moko-resources/vi/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">Di chuyển dữ liệu</string>
455455
<string name="first_run_dialog_no_thanks">Không, cảm ơn</string>
456456
<string name="welcome_dialog_button">Khám phá ứng dụng</string>
457+
<string name="empty_channel_playlists">Không có danh sách phát nào</string>
458+
<string name="empty_channel_albums">Không có album nào</string>
459+
<string name="empty_channel_videos">Không có video nào</string>
460+
<string name="empty_channel_lives">Không có buổi phát trực tiếp nào</string>
457461
</resources>

library/src/commonMain/moko-resources/zh-CN/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">数据迁移</string>
455455
<string name="first_run_dialog_no_thanks">不用了,谢谢</string>
456456
<string name="welcome_dialog_button">探索应用</string>
457+
<string name="empty_channel_playlists">没有播放列表</string>
458+
<string name="empty_channel_albums">没有专辑</string>
459+
<string name="empty_channel_videos">没有视频</string>
460+
<string name="empty_channel_lives">没有直播</string>
457461
</resources>

library/src/commonMain/moko-resources/zh-TW/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,8 @@
454454
<string name="data_migration_dialog_title">資料遷移</string>
455455
<string name="first_run_dialog_no_thanks">不用了,謝謝</string>
456456
<string name="welcome_dialog_button">探索應用程式</string>
457+
<string name="empty_channel_playlists">沒有播放清單</string>
458+
<string name="empty_channel_albums">沒有專輯</string>
459+
<string name="empty_channel_videos">沒有影片</string>
460+
<string name="empty_channel_lives">沒有直播</string>
457461
</resources>

0 commit comments

Comments
 (0)