Skip to content

Commit 69c91b6

Browse files
committed
Refactor: Move icon preferences to ProfilePrefsPage category
1 parent 41ffef7 commit 69c91b6

2 files changed

Lines changed: 18 additions & 34 deletions

File tree

Omega/src/com/neoapps/neolauncher/compose/pages/preferences/IconShapePage.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,16 @@ import androidx.compose.foundation.lazy.grid.GridCells
2727
import androidx.compose.foundation.lazy.grid.GridItemSpan
2828
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
2929
import androidx.compose.foundation.lazy.grid.itemsIndexed
30-
import androidx.compose.material3.HorizontalDivider
3130
import androidx.compose.runtime.Composable
3231
import androidx.compose.runtime.DisposableEffect
33-
import androidx.compose.runtime.getValue
3432
import androidx.compose.runtime.mutableStateOf
3533
import androidx.compose.runtime.remember
36-
import androidx.compose.runtime.setValue
3734
import androidx.compose.ui.Modifier
3835
import androidx.compose.ui.platform.LocalContext
3936
import androidx.compose.ui.res.stringResource
4037
import androidx.compose.ui.unit.dp
4138
import com.android.launcher3.R
4239
import com.neoapps.neolauncher.compose.components.ViewWithActionBar
43-
import com.neoapps.neolauncher.compose.components.preferences.PreferenceGroup
4440
import com.neoapps.neolauncher.icons.IconShape
4541
import com.neoapps.neolauncher.icons.IconShapeItem
4642
import com.neoapps.neolauncher.icons.IconShapeManager
@@ -71,16 +67,6 @@ fun IconShapePage() {
7167
IconShape.Teardrop,
7268
)
7369
val listItems = iconShapes.distinctBy { it.getMaskPath() }.map { ShapeModel(it.toString()) }
74-
val iconPrefs = listOf(
75-
prefs.profileIconAdaptify,
76-
prefs.profileIconColoredBackground
77-
)
78-
val openDialog = remember { mutableStateOf(false) }
79-
var dialogPref by remember { mutableStateOf<Any?>(null) }
80-
val onPrefDialog = { pref: Any ->
81-
dialogPref = pref
82-
openDialog.value = true
83-
}
8470

8571
Column(
8672
modifier = Modifier
@@ -111,20 +97,6 @@ fun IconShapePage() {
11197
}
11298
)
11399
}
114-
item(span = { GridItemSpan(maxLineSpan) }) {
115-
HorizontalDivider(
116-
modifier = Modifier.padding(horizontal = 16.dp),
117-
thickness = 1.dp
118-
)
119-
}
120-
121-
item(span = { GridItemSpan(maxLineSpan) }) {
122-
PreferenceGroup(
123-
heading = null,
124-
prefs = iconPrefs,
125-
onPrefDialog = onPrefDialog
126-
)
127-
}
128100
}
129101
}
130102
}

Omega/src/com/neoapps/neolauncher/compose/pages/preferences/ProfilePrefsPage.kt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,20 @@ fun ProfilePrefsPage() {
6868
prefs.profileLanguage,
6969
/*prefs.profileTheme,
7070
prefs.profileAccentColor,*/
71+
)
72+
73+
val iconPrefs = listOfNotNull(
7174
prefs.profileIconPack,
7275
prefs.profileIconShape,
73-
/*
74-
if (customIconsCount > 0) {
75-
prefs.profileResetCustomIcons
76-
} else {
77-
null
78-
}*/
76+
prefs.profileIconAdaptify,
77+
prefs.profileIconColoredBackground,
78+
if (customIconsCount > 0) {
79+
prefs.profileResetCustomIcons
80+
} else {
81+
null
82+
}
7983
)
84+
8085
val others = remember(prefs.changePoker.collectAsState(initial = 1).value) {
8186
mutableStateListOf(
8287
*listOfNotNull(
@@ -104,6 +109,13 @@ fun ProfilePrefsPage() {
104109
onPrefDialog = onPrefDialog
105110
)
106111
}
112+
item {
113+
PreferenceGroup(
114+
stringResource(id = R.string.cat_drawer_icons),
115+
prefs = iconPrefs,
116+
onPrefDialog = onPrefDialog
117+
)
118+
}
107119
item {
108120
PreferenceGroup(
109121
stringResource(id = R.string.pref_category__others),

0 commit comments

Comments
 (0)