From c7fb7f0e79918cd687651cf9238e4705f5f98239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=88=BA=E8=9E=88?= Date: Fri, 15 Nov 2024 23:28:09 +0800 Subject: [PATCH] perf: NavigationBar contentPadding --- app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt | 3 +-- app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt | 4 ++-- app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt | 4 ++-- app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt | 7 ++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt index daa57d4..cac7386 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt @@ -67,7 +67,6 @@ import li.songe.gkd.ui.component.QueryPkgAuthCard import li.songe.gkd.ui.style.EmptyHeight import li.songe.gkd.ui.style.appItemPadding import li.songe.gkd.ui.style.menuPadding -import li.songe.gkd.ui.style.scaffoldPadding import li.songe.gkd.util.LocalNavController import li.songe.gkd.util.SortTypeOption import li.songe.gkd.util.mapHashCode @@ -262,7 +261,7 @@ fun useAppListPage(): ScaffoldExt { } ) { contentPadding -> LazyColumn( - modifier = Modifier.scaffoldPadding(contentPadding), + modifier = Modifier.padding(contentPadding), state = listState ) { items(orderedAppInfos, { it.id }) { appInfo -> diff --git a/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt index 67eaeef..6f37226 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt @@ -87,7 +87,7 @@ fun useControlPage(): ScaffoldExt { } }) } - ) { padding -> + ) { contentPadding -> val latestRecordDesc by vm.latestRecordDescFlow.collectAsState() val subsStatus by vm.subsStatusFlow.collectAsState() val store by storeFlow.collectAsState() @@ -103,7 +103,7 @@ fun useControlPage(): ScaffoldExt { Column( modifier = Modifier .verticalScroll(scrollState) - .padding(padding) + .padding(contentPadding) ) { if (writeSecureSettings) { TextSwitch( diff --git a/app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt index e276e9a..cf4d895 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt @@ -191,11 +191,11 @@ fun useSettingsPage(): ScaffoldExt { ) }) }, - ) { padding -> + ) { contentPadding -> Column( modifier = Modifier .verticalScroll(scrollState) - .padding(padding) + .padding(contentPadding) ) { Text( diff --git a/app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt b/app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt index fda7c26..75f24ef 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt @@ -68,6 +68,7 @@ import li.songe.gkd.db.DbSet import li.songe.gkd.ui.component.SubsItemCard import li.songe.gkd.ui.component.TextMenu import li.songe.gkd.ui.component.waitResult +import li.songe.gkd.ui.style.EmptyHeight import li.songe.gkd.ui.style.itemVerticalPadding import li.songe.gkd.util.LOCAL_SUBS_ID import li.songe.gkd.util.SafeR @@ -342,7 +343,7 @@ fun useSubsManagePage(): ScaffoldExt { } } }, - ) { padding -> + ) { contentPadding -> val lazyListState = rememberLazyListState() val reorderableLazyColumnState = rememberReorderableLazyListState(lazyListState) { from, to -> @@ -358,7 +359,7 @@ fun useSubsManagePage(): ScaffoldExt { } Box( modifier = Modifier - .padding(padding) + .padding(contentPadding) .fillMaxSize() .pullRefresh(pullRefreshState, subItems.isNotEmpty()) ) { @@ -430,7 +431,7 @@ fun useSubsManagePage(): ScaffoldExt { } } item { - Spacer(modifier = Modifier.height(80.dp)) + Spacer(modifier = Modifier.height(EmptyHeight)) } } PullRefreshIndicator(