hanleyhansen
hanleyhansen

Reputation: 6437

Drawable on Android 4.2.2

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?

Upvotes: 0

Views: 506

Answers (1)

hanleyhansen
hanleyhansen

Reputation: 6437

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.

Upvotes: 1

Related Questions