Adds setting to not separate work profile and main profile apps (#678)

* Adds setting to not separate work profile and main profile apps

* Only show work profile related preference when there is a work profile

---------

Co-authored-by: MM20 <15646950+MM2-0@users.noreply.github.com>
This commit is contained in:
chaptergy
2024-03-28 21:00:06 +01:00
committed by GitHub
co-authored by MM20
parent 0e1f3f9be8
commit 3646745a36
7 changed files with 93 additions and 9 deletions
@@ -79,6 +79,7 @@ data class LauncherSettingsData(
val searchResultsReversed: Boolean = false,
val searchResultOrder: SearchResultOrder = SearchResultOrder.Weighted,
val separateWorkProfile: Boolean = true,
val rankingWeightFactor: WeightFactor = WeightFactor.Default,
@@ -62,4 +62,13 @@ class SearchUiSettings internal constructor(
}
}
val separateWorkProfile
get() = launcherDataStore.data.map { it.separateWorkProfile }.distinctUntilChanged()
fun setSeparateWorkProfile(separateWorkProfile: Boolean) {
launcherDataStore.update {
it.copy(separateWorkProfile = separateWorkProfile)
}
}
}