always redraw icons after fetching just to avoid some glitches
This commit is contained in:
parent
13b3e11c5c
commit
cc38bb4af4
|
@ -70,7 +70,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
getDefaultAppPackages()
|
getDefaultAppPackages()
|
||||||
config.wasHomeScreenInit = true
|
config.wasHomeScreenInit = true
|
||||||
home_screen_grid.fetchAppIcons(true)
|
home_screen_grid.fetchAppIcons()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,10 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
||||||
textSize = context.resources.getDimension(R.dimen.normal_text_size)
|
textSize = context.resources.getDimension(R.dimen.normal_text_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAppIcons(false)
|
fetchAppIcons()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fetchAppIcons(forceRedraw: Boolean) {
|
fun fetchAppIcons() {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
appIcons = context.homeScreenGridItemsDB.getAllItems() as ArrayList<HomeScreenGridItem>
|
appIcons = context.homeScreenGridItemsDB.getAllItems() as ArrayList<HomeScreenGridItem>
|
||||||
appIcons.forEach { item ->
|
appIcons.forEach { item ->
|
||||||
|
@ -51,9 +51,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forceRedraw) {
|
invalidate()
|
||||||
invalidate()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue