refresh the home screen once initial apps have been stored
This commit is contained in:
parent
e9c248b520
commit
13b3e11c5c
2 changed files with 9 additions and 0 deletions
|
@ -70,6 +70,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
|||
ensureBackgroundThread {
|
||||
getDefaultAppPackages()
|
||||
config.wasHomeScreenInit = true
|
||||
home_screen_grid.fetchAppIcons(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,10 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||
textSize = context.resources.getDimension(R.dimen.normal_text_size)
|
||||
}
|
||||
|
||||
fetchAppIcons(false)
|
||||
}
|
||||
|
||||
fun fetchAppIcons(forceRedraw: Boolean) {
|
||||
ensureBackgroundThread {
|
||||
appIcons = context.homeScreenGridItemsDB.getAllItems() as ArrayList<HomeScreenGridItem>
|
||||
appIcons.forEach { item ->
|
||||
|
@ -46,6 +50,10 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||
appIconDrawables[item.packageName] = drawable
|
||||
}
|
||||
}
|
||||
|
||||
if (forceRedraw) {
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue