Reputation: 73
I have a problem. How to use ColorPickerDialog ? How do I set ColorPickerDialog so as to change my text color?
Upvotes: 0
Views: 953
Reputation: 2116
Please have a look over this existing code..
http://www.yougli.net/android/a-photoshop-like-color-picker-for-your-android-application/
Upvotes: 1
Reputation: 20885
You can use this project instead of a demo app
// initialColor is the initially-selected color to be shown in the rectangle on the left of the arrow.
// for example, 0xff000000 is black, 0xff0000ff is blue. Please be aware of the initial 0xff which is the alpha.
AmbilWarnaDialog dialog = new AmbilWarnaDialog(this, initialColor, new OnAmbilWarnaListener() {
@Override
public void onOk(AmbilWarnaDialog dialog, int color) {
// color is the color selected by the user.
}
@Override
public void onCancel(AmbilWarnaDialog dialog) {
// cancel was selected by the user
}
});
dialog.show();
Be careful to this (I never used it myself):
You need to link against Android 3.0 or higher since there is an XML attribute layerType in use. This doesn't mean you can use this only for applications requiring Android 3.0 to operate. It works even in Android 1.6. You just need to select Android 3.0 (API level 11) on the project settings.
Upvotes: 0