Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Apr 2, 2024
1 parent 2da7e54 commit c0b4850
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
2 changes: 2 additions & 0 deletions lawnchair/src/app/lawnchair/override/CustomizeDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ fun CustomizeAppDialog(
defaultTitle: String,
componentKey: ComponentKey,
onClose: () -> Unit,
modifier: Modifier = Modifier,
) {
val prefs = preferenceManager()
val preferenceManager2 = preferenceManager2()
Expand Down Expand Up @@ -147,6 +148,7 @@ fun CustomizeAppDialog(
onTitleChange = { title = it },
defaultTitle = defaultTitle,
launchSelectIcon = openIconPicker,
modifier = modifier,
) {
PreferenceGroup(
description = componentKey.componentName.flattenToString(),
Expand Down
4 changes: 3 additions & 1 deletion lawnchair/src/app/lawnchair/ui/OverflowMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ fun OverflowMenu(
val showMenu = remember { mutableStateOf(false) }
val overflowMenuScope = remember { OverflowMenuScopeImpl(showMenu) }

Box(modifier = modifier) {
Box(
modifier = modifier,
) {
ClickableIcon(
imageVector = Icons.Rounded.MoreVert,
onClick = { showMenu.value = true },
Expand Down
4 changes: 3 additions & 1 deletion lawnchair/src/app/lawnchair/ui/preferences/Preferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ fun Preferences(
val isExpandedScreen = windowSizeClass.widthSizeClass == WindowWidthSizeClass.Expanded

Providers(isExpandedScreen) {
Surface(modifier = modifier) {
Surface(
modifier = modifier,
) {
CompositionLocalProvider(
LocalNavController provides navController,
LocalPreferenceInteractor provides interactor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ fun AnnouncementPreference(
announcements: ImmutableList<Announcement>,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier) {
Column(
modifier = modifier,
) {
announcements.forEachIndexed { index, announcement ->
var show by remember { mutableStateOf(true) }
AnnouncementItem(show, { show = false }, announcement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ fun CustomColorPicker(
)
}

Column(modifier = modifier) {
Column(
modifier = modifier,
) {
PreferenceGroup(
heading = stringResource(id = R.string.hex),
modifier = Modifier.padding(top = 8.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fun SwitchPreference(
onClick: (() -> Unit)? = null,
) {
PreferenceTemplate(
modifier = Modifier.clickable(enabled = enabled) {
modifier = modifier.clickable(enabled = enabled) {
if (onClick != null) {
onClick()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ fun PreferenceGroup(
dividersToSkip: Int = 0,
content: @Composable () -> Unit,
) {
Column(modifier = modifier) {
Column(
modifier = modifier,
) {
PreferenceGroupHeading(heading)
Surface(
modifier = Modifier.padding(horizontal = 16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fun PreferenceColumn(
content: @Composable ColumnScope.() -> Unit,
) {
NestedScrollStretch(
modifier = modifier,
content = {
Column(
verticalArrangement = verticalArrangement,
Expand All @@ -47,7 +48,6 @@ fun PreferenceColumn(
content = content,
)
},
modifier = modifier,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ fun AppDrawerPreferences(
val enableSmartHide = prefs2.enableSmartHide.getAdapter()
NavigationActionPreference(
label = stringResource(id = R.string.hidden_apps_label),
subtitle = resources.getQuantityString(
R.plurals.apps_count,
hiddenApps.size,
hiddenApps.size,
),
subtitle = resources.getQuantityString(R.plurals.apps_count, hiddenApps.size, hiddenApps.size),
destination = subRoute(name = AppDrawerRoutes.HIDDEN_APPS),
)
ExpandAndShrink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ fun IconPackPreferences(
.clip(MaterialTheme.shapes.large),
) {
WallpaperPreview(modifier = Modifier.fillMaxSize())
key(
iconPackAdapter.state.value,
themedIconPackAdapter.state.value,
themedIconsAdapter.state.value,
) {
key(iconPackAdapter.state.value, themedIconPackAdapter.state.value, themedIconsAdapter.state.value) {
DummyLauncherLayout(
idp = invariantDeviceProfile(),
modifier = Modifier.fillMaxSize(),
Expand Down Expand Up @@ -257,8 +253,7 @@ fun IconPackGrid(
themedIconPacks.filter { it.packageName != "" }
}
} else if (drawerThemedIcons) {
iconPacksLocal =
iconPacks.filter { it.packageName == "" || !themedIconPacksName.contains(it.name) }
iconPacksLocal = iconPacks.filter { it.packageName == "" || !themedIconPacksName.contains(it.name) }
}

val selectedPack = adapter.state.value
Expand Down Expand Up @@ -311,8 +306,7 @@ private fun getIconPackItemWidth(
while (true) {
gutterCount += 1f
visibleItemCount += 1f
val possibleIconPackItemWidth =
(availableWidth - gutterCount * gutterWidth) / visibleItemCount
val possibleIconPackItemWidth = (availableWidth - gutterCount * gutterWidth) / visibleItemCount
if (possibleIconPackItemWidth >= minimumWidth) {
iconPackItemWidth = possibleIconPackItemWidth
} else {
Expand Down

0 comments on commit c0b4850

Please sign in to comment.