0

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!

TheWizKid95
  • 721
  • 6
  • 16

1 Answers1

3

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!

Ilya Demidov
  • 3,275
  • 2
  • 26
  • 38
  • I already have the color picker set up as a library, and it's in my preference activity and everything, I just need help getting the result of the color picker to be set as the color for a textview – TheWizKid95 Jan 05 '13 at 10:05
  • Look at my updated answer. You just should set listener for your dialog. – Ilya Demidov Jan 05 '13 at 10:15
  • Could you further explain how to do so? I want to use text.setTextColor() in another activity while using the ColorPicker in my PreferencyActivity – TheWizKid95 Jan 05 '13 at 19:57
  • Just save your color to SHaredPreferences. And get it where you want. – Ilya Demidov Jan 06 '13 at 07:56
  • Can not understand, what color's form you want to get. As case you can get Alpha, Red, Green, Blue value use static methods of class Color, when you pass your int type color as parameter. – Ilya Demidov May 21 '14 at 10:14