Search code examples
androidcolor-pickerandroid-holo-everywhere

How would I implement this color picker in my app?


I'm currently using this colorpicker for android, but I'm not sure how to set a the textColor of a textview in another activity from this colorpicker. Anyone have any experience with this library? Thanks! Also, if you need any of my code, please ask!

EDIT: Thanks for the answer! I went with something similar, but your answer helped a lot!


Solution

  • Add project from gitHab as Library project and use ColorPickerDialog in your project as you use simple Dialog. From readme https://github.com/gsingh93/android-ColorPickerPreference#readme you can use ColorPickerPreference in PreferenceActivity.

    Just set onColorChangeListener like this :

    public void setOnColorChangedListener(OnColorChangedListener listener) {
        mListener = listener;
    }
    

    From source code on gitHub it's right way) Because this callback will call if user do click on panel and choose any color.

    Good luck!