Open edwardrowe opened 12 years ago
It has something to do with when all packs are highlighted (or black).
It seems the last pack highlighted goes black if all other packs are highlighted (or black). Sometimes packs are refreshed as well. EX: Suppose you have 3 packs: 1, 2 and 3. Start Pack Purchase, none are highlighted. Highlight packs in the following order: 1 2 3 - 3rd pack goes black Unselect pack 2 and 3rd pack goes blue ReSelect pack 2 and it will be black
Whether or not the Black row goes Blue when a pack is unselected seems to be dependent on if the black pack is below the pack that was unselected in the list.
Well, trying to isolate this bug I think it has something to do with multiple calls to mContents.setBackgroundColor() in a single frame. I think this happens with Invalidate() being called inside a LinearLayout or something, which causes the predecessors of the redrawn element to also redraw, maybe itself included (?) thus calling a double draw on the clicked element.
Things I tried: postInvalidate() seemed to fix it almost 100%, but sometimes it still went black. Instead of using SetBackground, I did setBackgroundDrawable() to a ColorDrawable I created from the passed in color. This worked 100%, but I think it may have been slow.
Edit: Added code sample: //ColorDrawable newbg = new ColorDrawable(backgroundColor); //mContents.setBackgroundDrawable(newbg);
Well somehow this has gone away. I tweaked the PackInfo icon drawables, but that's really it. We'll keep an eye on this.
On the newer phones, the pack purchase rows go black when selected sometimes. Still working on repro steps.