Fix: Hide self from app list.

This commit is contained in:
HeCodes2Much
2024-05-11 19:27:00 +01:00
parent e6ec1837fb
commit d494284901
3 changed files with 7 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
package com.github.droidworksstudio.launcher
object Constants {
const val PACKAGE_NAME = "com.github.droidworksstudio.launcher"
const val PACKAGE_NAME = "app.easy.launcher"
const val PACKAGE_NAME_DEBUG = "$PACKAGE_NAME.debug"
const val PREFS_FILENAME = "EasyLauncher.pref"
const val FIRST_LAUNCH = "FIRST_LAUNCH"

View File

@@ -109,14 +109,14 @@ class AppInfoRepository @Inject constructor(
val launcherApps =
context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
val excludedPackageName = Constants.PACKAGE_NAME
val excludedPackageNames = mutableListOf(Constants.PACKAGE_NAME,Constants.PACKAGE_NAME_DEBUG)
val newAppList: List<AppInfo> = userManager.userProfiles
.flatMap { profile ->
launcherApps.getActivityList(null, profile)
.mapNotNull { app ->
val packageName = app.applicationInfo.packageName
if (packageName !in existingPackageNames && packageName != excludedPackageName) {
if (packageName !in existingPackageNames && packageName !in excludedPackageNames) {
AppInfo(
appName = app.label.toString(),
packageName = packageName,

View File

@@ -18,12 +18,12 @@
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:visibility="visible"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/linear_layout"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
@@ -44,7 +44,7 @@
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:visibility="visible"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/linear_layout"/>