mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-04-03 21:01:01 +02:00
get proper app launcher icons at apps from the suite
This commit is contained in:
parent
5105449e0a
commit
4a78b580dc
@ -41,7 +41,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
|
|||||||
|
|
||||||
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
||||||
val launcher = launchers[position]
|
val launcher = launchers[position]
|
||||||
val view = holder.bindView(launcher) { itemView, layoutPosition ->
|
val view = holder.bindView(launcher) { itemView, adapterPosition ->
|
||||||
setupView(itemView, launcher)
|
setupView(itemView, launcher)
|
||||||
}
|
}
|
||||||
bindViewHolder(holder, position, view)
|
bindViewHolder(holder, position, view)
|
||||||
|
@ -123,7 +123,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
val packageName = cursor.getStringValue(COL_PKG_NAME)
|
val packageName = cursor.getStringValue(COL_PKG_NAME)
|
||||||
|
|
||||||
val drawable = if (packageName.isAPredefinedApp()) {
|
val drawable = if (packageName.isAPredefinedApp()) {
|
||||||
resources.getLauncherDrawable(packageName)
|
try {
|
||||||
|
packageManager.getApplicationIcon(packageName)
|
||||||
|
} catch (e: PackageManager.NameNotFoundException) {
|
||||||
|
resources.getLauncherDrawable(packageName)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
packageManager.getApplicationIcon(packageName)
|
packageManager.getApplicationIcon(packageName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user