mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-05-31 19:09:21 +02:00
if sorting is set to custom, use title sorting at app picker
This commit is contained in:
parent
5c609d6acb
commit
1f9daf50cc
@ -8,6 +8,7 @@ import android.graphics.drawable.Drawable
|
|||||||
import com.simplemobiletools.applauncher.helpers.Config
|
import com.simplemobiletools.applauncher.helpers.Config
|
||||||
import com.simplemobiletools.applauncher.helpers.DBHelper
|
import com.simplemobiletools.applauncher.helpers.DBHelper
|
||||||
import com.simplemobiletools.applauncher.models.AppLauncher
|
import com.simplemobiletools.applauncher.models.AppLauncher
|
||||||
|
import com.simplemobiletools.commons.helpers.SORT_BY_CUSTOM
|
||||||
|
|
||||||
val Context.config: Config get() = Config.newInstance(applicationContext)
|
val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||||
|
|
||||||
@ -47,8 +48,12 @@ fun Context.getNotDisplayedLaunchers(displayedLaunchers: ArrayList<AppLauncher>)
|
|||||||
allApps.add(AppLauncher(0, label, packageName, drawable))
|
allApps.add(AppLauncher(0, label, packageName, drawable))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.sorting and SORT_BY_CUSTOM != 0) {
|
||||||
|
allApps.sortBy { it.title.toLowerCase() }
|
||||||
|
} else {
|
||||||
AppLauncher.sorting = config.sorting
|
AppLauncher.sorting = config.sorting
|
||||||
allApps.sort()
|
allApps.sort()
|
||||||
|
}
|
||||||
|
|
||||||
val unique = allApps.distinctBy { it.packageName }
|
val unique = allApps.distinctBy { it.packageName }
|
||||||
return unique.filter { !displayedLaunchers.contains(it) && it.packageName != "com.simplemobiletools.applauncher" } as ArrayList<AppLauncher>
|
return unique.filter { !displayedLaunchers.contains(it) && it.packageName != "com.simplemobiletools.applauncher" } as ArrayList<AppLauncher>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user