0

My app works fine in anything before 4.2 but when using 4.2 my drawable hexagons aren't showing. I have a custom class that extends Drawable.

Custom class:

https://gist.github.com/hanleyhansen/8a6bea78017d219a34ef

I then added 2 classes namely this:

https://gist.github.com/hanleyhansen/5deadaebea36e23b0579

This is my full custom class now:

https://gist.github.com/hanleyhansen/32788d63c672cf394e4e

So with that my hexagons show up but they are grey?!?!

This is how I'm drawing my hexagons:

https://gist.github.com/hanleyhansen/d7e5bb9654d97994dfdf

Grey Hexagons

What's the deal with Android 4.2.2 and Drawable? Any idea why now the colors are not being applied to the hexagons and I'm just getting this greyscale? Would you recommend a different solution as opposed to my added classes?

hanleyhansen
  • 6,304
  • 8
  • 37
  • 73
  • could you please post the bare minimal project that shows your problem? maybe just an activity that shows a single hexagon, which works on all versions besides 4.2 ? that would make it easier for us to test it out and check why it occurs... – android developer Jun 08 '13 at 22:07
  • @androiddeveloper The easiest way to reproduce it would be using this: https://badgerati.wordpress.com/2012/07/24/drawable-polygon/ which is where I got my custom class from. – hanleyhansen Jun 08 '13 at 22:13
  • do they have a sample project? i could test the project on my 4.2 device if you wish. – android developer Jun 08 '13 at 22:18
  • @androiddeveloper sure. can you join the Android chat room so I can send you a link? – hanleyhansen Jun 08 '13 at 22:23

1 Answers1

1

I ended up replacing the HexagonDrawable class with my own implementation of a HexagonShape which extends shape. This works in 4.2 and in the previous versions as expected. Hope this helps someone.

hanleyhansen
  • 6,304
  • 8
  • 37
  • 73