mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-02-07 23:38:54 +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 name = cursor.getString(cursor.getColumnIndex(DbHelper.NAME))
|
||||||
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
||||||
val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID))
|
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)
|
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 name = cursor.getString(cursor.getColumnIndex(DbHelper.NAME))
|
||||||
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
val pkgName = cursor.getString(cursor.getColumnIndex(DbHelper.PKG_NAME))
|
||||||
val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID))
|
val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID))
|
||||||
launchers.add(AppLauncher(name, pkgName, icon, null))
|
launchers.add(AppLauncher(name, pkgName, icon))
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
@ -41,8 +41,7 @@ class AddAppDialog() : DialogFragment() {
|
|||||||
val componentInfo = info.activityInfo.applicationInfo
|
val componentInfo = info.activityInfo.applicationInfo
|
||||||
val label = componentInfo.loadLabel(packageManager).toString()
|
val label = componentInfo.loadLabel(packageManager).toString()
|
||||||
val pkgName = componentInfo.packageName
|
val pkgName = componentInfo.packageName
|
||||||
val icon = componentInfo.loadIcon(packageManager)
|
apps.add(AppLauncher(label, pkgName, 0))
|
||||||
apps.add(AppLauncher(label, pkgName, 0, icon))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val sorted = apps.sortedWith(compareBy { it.name.toLowerCase() })
|
val sorted = apps.sortedWith(compareBy { it.name.toLowerCase() })
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
package com.simplemobiletools.applauncher.models
|
package com.simplemobiletools.applauncher.models
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
data class AppLauncher(val name: String, val pkgName: String, val iconId: Int)
|
||||||
|
|
||||||
data class AppLauncher(val name: String, val pkgName: String, val iconId: Int, val drawable: Drawable?)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user