kristiyanP / colorpicker

A simple color picker library for Android
Apache License 2.0
193 stars 43 forks source link

Context instead of Activity? #7

Closed 12people closed 8 years ago

12people commented 8 years ago

I'm calling the picker from an OnClickAdapter inside a RecyclerHolder, where I only have access to an unspecified Context. Right now, I'm casting Context to Activity, but that's a pretty ugly way to do things. I've taken a quick look at the code and it seems like Activity could be exchanged for the more generic Context. Would that be possible? Is there a reason for prefering Activity?

12people commented 8 years ago

When exchanging Activity for Context, instead of calling getLayoutInflater(), call LayoutInflater.from(context) .

kristiyanP commented 8 years ago

Changed in version 1.1.0