Skip to content

Commit

Permalink
Fix for app groups and default apps
Browse files Browse the repository at this point in the history
  • Loading branch information
wurzer committed Nov 10, 2024
1 parent 099f1c3 commit a7080d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 5 additions & 3 deletions AppGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,10 @@ LauncherPage {
var groupedApps = appLauncher.getGroupedApps(appsArray)
appLauncher.destroyAppGroups()
appLauncher.createAppGroups(groupedApps)
// Workaround, if users didn't update the os version
if (!appsString.includes("org.fossify.gallery")) mainView.galleryApp = "com.simplemobiletools.gallery.pro"
// Reflect different OS versions and devices
mainView.checkDefaultApps(appsArray)
//if (!appsString.includes("org.fossify.gallery")) mainView.galleryApp = "com.simplemobiletools.gallery.pro"
//if (!appsString.includes("org.fossify.calendar")) mainView.galleryApp = "com.simplemobiletools.calendar.pro"
} else {
console.log("AppLauncher | Need to retrieve apps from system")
mainView.updateSpinner(true)
Expand Down Expand Up @@ -552,7 +554,7 @@ LauncherPage {
}
}
mainView.updateSpinner(false)
mainView.checkDefaultApps(getAllApps())
mainView.checkDefaultApps(message["apps"])
} else if (type === "volla.launcher.receivedShortcut") {
console.log("AppGrid | New pinned shortcut: " + message["shortcutId"])

Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.4.21" android:versionCode="317" android:installLocation="auto">
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.4.22" android:versionCode="318" android:installLocation="auto">
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
12 changes: 8 additions & 4 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ ApplicationWindow {
property int maxTitleLength: 120

property string galleryApp: "org.fossify.gallery"
property string calendarApp: "com.simplemobiletools.calendar.pro"
property string calendarApp: "org.fossify.calendar"
property string cameraApp: "com.mediatek.camera"
property string phoneApp: "com.android.dialer"
property string notesApp: "org.fossify.notes"
Expand Down Expand Up @@ -919,10 +919,14 @@ ApplicationWindow {
}
}

function checkDefaultApp(apps) {
mainView.galleryApp = apps.filter( el => el.package !== "org.fossify.gallery" ).length > 0 ?
function checkDefaultApps(apps) {
console.debug("MainView | Will check apps")
console.debug(apps.filter( el => el.package === "org.fossify.gallery" ).length)
console.debug(apps.filter( el => el.package === "org.fossify.calendar" ).length)

mainView.galleryApp = apps.filter( el => el.package === "org.fossify.gallery" ).length > 0 ?
"org.fossify.gallery" : "com.simplemobiletools.gallery.pro"
mainView.calendarApp = apps.filter( el => el.package !== "org.fossify.calendar" ).length > 0 ?
mainView.calendarApp = apps.filter( el => el.package === "org.fossify.calendar" ).length > 0 ?
"org.fossify.calendar" : "com.simplemobiletools.calendar.pro"
}

Expand Down

0 comments on commit a7080d1

Please sign in to comment.