mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-02-01 09:56:47 +01:00
remove the redundant Drawable field of AppLauncher
This commit is contained in:
parent
0bc34273d7
commit
9c30b32b8d
@ -25,7 +25,7 @@ class MyCursorAdapter(cxt: Context, dataCursor: Cursor, val itemClick: (AppLaunc
|
||||
val name = cursor.getString(cursor.getColumnIndex(DbHelper.NAME))
|
||||
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
||||
val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID))
|
||||
val launcher = AppLauncher(name, pkgName, icon, null)
|
||||
val launcher = AppLauncher(name, pkgName, icon)
|
||||
holder.bindView(context, launcher)
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class DbHelper(context: Context) : SQLiteOpenHelper(context, "launchers.db", nul
|
||||
val name = cursor.getString(cursor.getColumnIndex(DbHelper.NAME))
|
||||
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
||||
val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID))
|
||||
launchers.add(AppLauncher(name, pkgName, icon, null))
|
||||
launchers.add(AppLauncher(name, pkgName, icon))
|
||||
}
|
||||
} finally {
|
||||
cursor.close()
|
||||
|
@ -41,8 +41,7 @@ class AddAppDialog() : DialogFragment() {
|
||||
val componentInfo = info.activityInfo.applicationInfo
|
||||
val label = componentInfo.loadLabel(packageManager).toString()
|
||||
val pkgName = componentInfo.packageName
|
||||
val icon = componentInfo.loadIcon(packageManager)
|
||||
apps.add(AppLauncher(label, pkgName, 0, icon))
|
||||
apps.add(AppLauncher(label, pkgName, 0))
|
||||
}
|
||||
|
||||
val sorted = apps.sortedWith(compareBy { it.name.toLowerCase() })
|
||||
|
@ -1,5 +1,3 @@
|
||||
package com.simplemobiletools.applauncher.models
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
|
||||
data class AppLauncher(val name: String, val pkgName: String, val iconId: Int, val drawable: Drawable?)
|
||||
data class AppLauncher(val name: String, val pkgName: String, val iconId: Int)
|
||||
|
Loading…
x
Reference in New Issue
Block a user