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 {
|
||||
getDefaultAppPackages()
|
||||
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)
|
||||
}
|
||||
|
||||
fetchAppIcons(false)
|
||||
fetchAppIcons()
|
||||
}
|
||||
|
||||
fun fetchAppIcons(forceRedraw: Boolean) {
|
||||
fun fetchAppIcons() {
|
||||
ensureBackgroundThread {
|
||||
appIcons = context.homeScreenGridItemsDB.getAllItems() as ArrayList<HomeScreenGridItem>
|
||||
appIcons.forEach { item ->
|
||||
|
@ -51,11 +51,9 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||
}
|
||||
}
|
||||
|
||||
if (forceRedraw) {
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("DrawAllocation")
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
|
|
Loading…
Reference in New Issue