fix: hide µLauncher by default

This commit is contained in:
Josia Pietsch 2024-11-27 01:39:10 +01:00
parent 3ae2e36ee0
commit 7f2a52c79c
Signed by: jrpie
GPG key ID: E70B571D66986A2D
2 changed files with 13 additions and 13 deletions

View file

@ -418,18 +418,18 @@ fun resetPreferences(context: Context) {
LauncherPreferences.clear()
LauncherPreferences.internal().versionCode(PREFERENCE_VERSION)
LauncherPreferences.apps().hidden(
LauncherPreferences.apps().hidden()?.also {
it.add(
DetailedAppInfo.fromAppInfo(
val hidden: MutableSet<AppInfo> = mutableSetOf()
val launcher = DetailedAppInfo.fromAppInfo(
AppInfo(
BuildConfig.APPLICATION_ID,
HomeActivity::class.java.name,
AppInfo.INVALID_USER
), context
)?.app
)
})
launcher?.app?.let { hidden.add(it) }
Log.i(TAG,"Hiding ${launcher?.app}")
LauncherPreferences.apps().hidden(hidden)
Action.resetToDefaultActions(context)
}

View file

@ -168,7 +168,7 @@ class AppsRecyclerAdapter(
}
R.id.app_menu_hidden -> {
var hidden: MutableSet<AppInfo> =
val hidden: MutableSet<AppInfo> =
LauncherPreferences.apps().hidden() ?: mutableSetOf()
if (hidden.contains(appInfo.app)) {
hidden.remove(appInfo.app)