Prevent mutating drawables for items in app drawer
This commit is contained in:
parent
78d9459e9a
commit
681e50993f
1 changed files with 4 additions and 3 deletions
|
@ -1110,8 +1110,9 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||
// show the app icon itself at dragging, move it above the finger a bit to make it visible
|
||||
val drawableX = (draggedItemCurrentCoords.first - iconSize / 1.5f).toInt()
|
||||
val drawableY = (draggedItemCurrentCoords.second - iconSize / 1.2f).toInt()
|
||||
draggedItem!!.drawable?.setBounds(drawableX, drawableY, drawableX + iconSize, drawableY + iconSize)
|
||||
draggedItem!!.drawable?.draw(canvas)
|
||||
val newDrawable = draggedItem!!.drawable?.constantState?.newDrawable()?.mutate()
|
||||
newDrawable?.setBounds(drawableX, drawableY, drawableX + iconSize, drawableY + iconSize)
|
||||
newDrawable?.draw(canvas)
|
||||
} else if (draggedItem!!.type == ITEM_TYPE_WIDGET) {
|
||||
// at first draw we are loading the widget from the database at some exact spot, not dragging it
|
||||
if (!isFirstDraw) {
|
||||
|
@ -1458,7 +1459,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||
val drawable = if (item.type == ITEM_TYPE_FOLDER) {
|
||||
item.toFolder().generateDrawable()
|
||||
} else {
|
||||
item.drawable
|
||||
item.drawable?.constantState?.newDrawable()?.mutate()
|
||||
}
|
||||
|
||||
if (item.docked) {
|
||||
|
|
Loading…
Reference in a new issue