siramix / buzzwords

A mobile word game that will change the word.
www.siramix.com/buzzwords
GNU General Public License v3.0
10 stars 1 forks source link

Pack Purchase Rows are black on new phones #86

Open edwardrowe opened 11 years ago

edwardrowe commented 11 years ago

On the newer phones, the pack purchase rows go black when selected sometimes. Still working on repro steps.

edwardrowe commented 11 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.

edwardrowe commented 11 years ago

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);

edwardrowe commented 11 years ago

Well somehow this has gone away. I tweaked the PackInfo icon drawables, but that's really it. We'll keep an eye on this.