get proper app launcher icons at apps from the suite

This commit is contained in:
tibbi 2018-05-22 14:28:45 +02:00
parent 5105449e0a
commit 4a78b580dc
2 changed files with 6 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val launcher = launchers[position]
val view = holder.bindView(launcher) { itemView, layoutPosition ->
val view = holder.bindView(launcher) { itemView, adapterPosition ->
setupView(itemView, launcher)
}
bindViewHolder(holder, position, view)

View File

@ -123,7 +123,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
val packageName = cursor.getStringValue(COL_PKG_NAME)
val drawable = if (packageName.isAPredefinedApp()) {
try {
packageManager.getApplicationIcon(packageName)
} catch (e: PackageManager.NameNotFoundException) {
resources.getLauncherDrawable(packageName)
}
} else {
try {
packageManager.getApplicationIcon(packageName)