优化
This commit is contained in:
2 files changed
+6
-26
No files matched your search
@@ -40,8 +40,9 @@ jobs:
|
|||||||
latest_tag: ${{ steps.set-ver.outputs.last_tag }}
|
latest_tag: ${{ steps.set-ver.outputs.last_tag }}
|
||||||
is_release: ${{ steps.set-ver.outputs.is_release }}
|
is_release: ${{ steps.set-ver.outputs.is_release }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: 计算版本号和构建号
|
- name: 计算版本号和构建号
|
||||||
@@ -248,8 +249,9 @@ jobs:
|
|||||||
success()
|
success()
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# 1. 下载 build 任务上传的所有 APK
|
# 1. 下载 build 任务上传的所有 APK
|
||||||
|
|||||||
@@ -104,30 +104,20 @@ fun HomepageScreen(
|
|||||||
uiState.manageState.sets.filter { it.isSelected }
|
uiState.manageState.sets.filter { it.isSelected }
|
||||||
}
|
}
|
||||||
val pagerState = rememberPagerState(pageCount = {
|
val pagerState = rememberPagerState(pageCount = {
|
||||||
if (layoutMode == 1) selectedSets.size.coerceAtLeast(1) else 1
|
selectedSets.size.coerceAtLeast(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
val mixedGridState = rememberLazyStaggeredGridState()
|
|
||||||
val homeString = stringResource(R.string.home)
|
val homeString = stringResource(R.string.home)
|
||||||
val currentTitle by remember(
|
val currentTitle by remember(
|
||||||
layoutMode,
|
layoutMode,
|
||||||
pagerState.currentPage,
|
pagerState.currentPage,
|
||||||
selectedSets,
|
selectedSets,
|
||||||
uiState.modules
|
|
||||||
) {
|
) {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
if (layoutMode == 1) {
|
if (layoutMode == 1) {
|
||||||
homeString
|
homeString
|
||||||
} else {
|
} else {
|
||||||
val firstHeader = mixedGridState.layoutInfo.visibleItemsInfo.firstOrNull {
|
selectedSets.getOrNull(pagerState.currentPage)?.sourceName ?: homeString
|
||||||
(it.key as? String)?.startsWith("header_") == true
|
|
||||||
}
|
|
||||||
if (firstHeader != null) {
|
|
||||||
val id = (firstHeader.key as? String).orEmpty().substringAfter("header_", "")
|
|
||||||
uiState.modules.find { it.globalId == id }?.setName ?: homeString
|
|
||||||
} else {
|
|
||||||
homeString
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,17 +189,6 @@ fun HomepageScreen(
|
|||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(paddingValues),
|
.padding(paddingValues),
|
||||||
) {
|
) {
|
||||||
if (layoutMode == 0) {
|
|
||||||
ModuleList(
|
|
||||||
modules = uiState.modules,
|
|
||||||
viewModel = viewModel,
|
|
||||||
gridState = mixedGridState,
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
|
||||||
onErrorClick = { errorMsg = it },
|
|
||||||
sharedTransitionScope = sharedTransitionScope,
|
|
||||||
animatedVisibilityScope = animatedVisibilityScope,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
if (selectedSets.isEmpty()) {
|
if (selectedSets.isEmpty()) {
|
||||||
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
AppText(stringResource(R.string.homepage_no_source_sets_selected))
|
AppText(stringResource(R.string.homepage_no_source_sets_selected))
|
||||||
@@ -243,7 +222,6 @@ fun HomepageScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
AppAlertDialog(
|
AppAlertDialog(
|
||||||
data = errorMsg,
|
data = errorMsg,
|
||||||
|
|||||||
Reference in new issue
Block a user