1.资源库页面增加无数据状态显示
This commit is contained in:
1 parent
24c493f448
commit
4a7adfadaa
4 files changed
+81
-33
No files matched your search
@@ -173,12 +173,7 @@ fun MainApp() {
|
||||
when (selectedTab) {
|
||||
0 -> Spacer(Modifier.height(0.dp))
|
||||
1 -> Spacer(Modifier.height(0.dp))
|
||||
2 -> LibraryTopBar(
|
||||
isGrid = libraryIsGrid,
|
||||
onViewToggle = { libraryIsGrid = !libraryIsGrid },
|
||||
onAdd = { showLibraryAddDialog = true },
|
||||
onOpenIconLibraryManager = { showIconLibraryManager = true },
|
||||
)
|
||||
2 -> Spacer(Modifier.height(0.dp))
|
||||
3 -> {
|
||||
if (showCacheDetail) {
|
||||
Row(
|
||||
@@ -289,6 +284,9 @@ fun MainApp() {
|
||||
showAddDialog = showLibraryAddDialog,
|
||||
onDismissAddDialog = { showLibraryAddDialog = false },
|
||||
isGrid = libraryIsGrid,
|
||||
onViewToggle = { libraryIsGrid = !libraryIsGrid },
|
||||
onAdd = { showLibraryAddDialog = true },
|
||||
onOpenIconLibraryManager = { showIconLibraryManager = true },
|
||||
onChangeIconTarget = changeIconTarget,
|
||||
onDismissChangeIcon = { changeIconTarget = null },
|
||||
onPickIcon = { server, iconUrl ->
|
||||
|
||||
@@ -275,6 +275,9 @@ fun LibraryScreen(
|
||||
onDismissChangeIcon: () -> Unit = {},
|
||||
onPickIcon: (EmbyServer, String) -> Unit = { _, _ -> },
|
||||
onRequestChangeIcon: (EmbyServer) -> Unit = {},
|
||||
onViewToggle: () -> Unit = {},
|
||||
onAdd: () -> Unit = {},
|
||||
onOpenIconLibraryManager: () -> Unit = {},
|
||||
) {
|
||||
var editingServer by remember { mutableStateOf<EmbyServer?>(null) }
|
||||
|
||||
@@ -299,35 +302,78 @@ fun LibraryScreen(
|
||||
onPick = { srv, url -> onPickIcon(srv, url); onDismissChangeIcon() },
|
||||
)
|
||||
}
|
||||
LazyVerticalGrid(
|
||||
columns = if (isGrid) GridCells.Fixed(2) else GridCells.Fixed(1),
|
||||
modifier = Modifier.fillMaxSize().padding(horizontal = if (isGrid) 16.dp else 0.dp),
|
||||
contentPadding = PaddingValues(top = 16.dp, bottom = bottomBarContentPadding(86.dp).calculateBottomPadding()),
|
||||
verticalArrangement = Arrangement.spacedBy(if (isGrid) 12.dp else 10.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(if (isGrid) 12.dp else 0.dp),
|
||||
) {
|
||||
// Servers section
|
||||
items(servers.size) { index ->
|
||||
val server = servers[index]
|
||||
val tint = serverTints[index % serverTints.size]
|
||||
if (isGrid) {
|
||||
ServerGridCard(
|
||||
server = server, tint = tint,
|
||||
onClick = { onSelectServer(server.id) },
|
||||
onChangeIcon = { onRequestChangeIcon(server) },
|
||||
onDelete = { onDeleteServer(server.id) },
|
||||
onEdit = { editingServer = server },
|
||||
)
|
||||
} else {
|
||||
ServerCard(
|
||||
server = server, tint = tint,
|
||||
onClick = { onSelectServer(server.id) },
|
||||
onChangeIcon = { onRequestChangeIcon(server) },
|
||||
onDelete = { onDeleteServer(server.id) },
|
||||
onEdit = { editingServer = server },
|
||||
)
|
||||
Box(Modifier.fillMaxSize()) {
|
||||
|
||||
if (servers.isEmpty()) {
|
||||
Box(
|
||||
Modifier.fillMaxSize().padding(bottom = bottomBarContentPadding(90.dp).calculateBottomPadding()),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Box(
|
||||
Modifier
|
||||
.size(64.dp)
|
||||
.clip(CircleShape)
|
||||
.background(GlassTokens.glassFill)
|
||||
.border(1.dp, GlassTokens.glassBorder, CircleShape),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Add,
|
||||
contentDescription = null,
|
||||
tint = GlassTokens.subtext2,
|
||||
modifier = Modifier.size(32.dp),
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Text(text = stringResource(Res.string.empty_servers), color = GlassTokens.subtext, fontSize = 15.sp)
|
||||
Spacer(Modifier.height(6.dp))
|
||||
Text(text = stringResource(Res.string.empty_servers_sub), color = GlassTokens.subtext, fontSize = 12.sp)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LazyVerticalGrid(
|
||||
columns = if (isGrid) GridCells.Fixed(2) else GridCells.Fixed(1),
|
||||
modifier = Modifier.fillMaxSize().padding(horizontal = if (isGrid) 16.dp else 0.dp),
|
||||
contentPadding = PaddingValues(top = 16.dp, bottom = bottomBarContentPadding(86.dp).calculateBottomPadding()),
|
||||
verticalArrangement = Arrangement.spacedBy(if (isGrid) 12.dp else 10.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(if (isGrid) 12.dp else 0.dp),
|
||||
) {
|
||||
// Servers section
|
||||
items(servers.size) { index ->
|
||||
val server = servers[index]
|
||||
val tint = serverTints[index % serverTints.size]
|
||||
if (isGrid) {
|
||||
ServerGridCard(
|
||||
server = server, tint = tint,
|
||||
onClick = { onSelectServer(server.id) },
|
||||
onChangeIcon = { onRequestChangeIcon(server) },
|
||||
onDelete = { onDeleteServer(server.id) },
|
||||
onEdit = { editingServer = server },
|
||||
)
|
||||
} else {
|
||||
ServerCard(
|
||||
server = server, tint = tint,
|
||||
onClick = { onSelectServer(server.id) },
|
||||
onChangeIcon = { onRequestChangeIcon(server) },
|
||||
onDelete = { onDeleteServer(server.id) },
|
||||
onEdit = { editingServer = server },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Overlay top bar (same pattern as HomeScreen)
|
||||
LibraryTopBar(
|
||||
isGrid = isGrid,
|
||||
onViewToggle = onViewToggle,
|
||||
onAdd = onAdd,
|
||||
onOpenIconLibraryManager = onOpenIconLibraryManager,
|
||||
modifier = Modifier.align(Alignment.TopCenter),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@
|
||||
<string name="empty_home_no_data_sub">The current server has no content available</string>
|
||||
<string name="empty_favorites">No favorites yet</string>
|
||||
<string name="empty_favorites_sub">Browse media and add to favorites</string>
|
||||
<string name="empty_servers">No servers yet</string>
|
||||
<string name="empty_servers_sub">Tap the add button to get started</string>
|
||||
<string name="empty_calendar">No calendar data</string>
|
||||
<string name="empty_calendar_sub">Calendar feature coming soon</string>
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@
|
||||
<string name="empty_home_no_data_sub">当前服务器暂无可用内容</string>
|
||||
<string name="empty_favorites">暂无收藏内容</string>
|
||||
<string name="empty_favorites_sub">浏览媒体并添加收藏</string>
|
||||
<string name="empty_servers">暂无服务器</string>
|
||||
<string name="empty_servers_sub">点击右上角添加服务器</string>
|
||||
<string name="empty_calendar">暂无日历数据</string>
|
||||
<string name="empty_calendar_sub">日历功能即将推出</string>
|
||||
|
||||
|
||||
Reference in new issue
Block a user