Skip to content

Commit

Permalink
perf: NavigationBar contentPadding
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 15, 2024
1 parent dff1c5a commit c7fb7f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -262,7 +261,7 @@ fun useAppListPage(): ScaffoldExt {
}
) { contentPadding ->
LazyColumn(
modifier = Modifier.scaffoldPadding(contentPadding),
modifier = Modifier.padding(contentPadding),
state = listState
) {
items(orderedAppInfos, { it.id }) { appInfo ->
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -103,7 +103,7 @@ fun useControlPage(): ScaffoldExt {
Column(
modifier = Modifier
.verticalScroll(scrollState)
.padding(padding)
.padding(contentPadding)
) {
if (writeSecureSettings) {
TextSwitch(
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ fun useSettingsPage(): ScaffoldExt {
)
})
},
) { padding ->
) { contentPadding ->
Column(
modifier = Modifier
.verticalScroll(scrollState)
.padding(padding)
.padding(contentPadding)
) {

Text(
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/kotlin/li/songe/gkd/ui/home/SubsManagePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -342,7 +343,7 @@ fun useSubsManagePage(): ScaffoldExt {
}
}
},
) { padding ->
) { contentPadding ->
val lazyListState = rememberLazyListState()
val reorderableLazyColumnState =
rememberReorderableLazyListState(lazyListState) { from, to ->
Expand All @@ -358,7 +359,7 @@ fun useSubsManagePage(): ScaffoldExt {
}
Box(
modifier = Modifier
.padding(padding)
.padding(contentPadding)
.fillMaxSize()
.pullRefresh(pullRefreshState, subItems.isNotEmpty())
) {
Expand Down Expand Up @@ -430,7 +431,7 @@ fun useSubsManagePage(): ScaffoldExt {
}
}
item {
Spacer(modifier = Modifier.height(80.dp))
Spacer(modifier = Modifier.height(EmptyHeight))
}
}
PullRefreshIndicator(
Expand Down

0 comments on commit c7fb7f0

Please sign in to comment.