0

I have this code running: Color picker with usage in android perfectly, althought it doens't show the color white, gray, black, etc..to choose.

What do I need to change in code for being able to choose that colors?

Thank you!

Community
  • 1
  • 1
user2902515
  • 193
  • 1
  • 2
  • 11

1 Answers1

0

You can customize the one that you mentioned in your question also. You will need to do some modifications in the ColorPickerView class.

You can also try an alternative color picker available in the below link.

  1. Download the zip file from

    http://code.google.com/p/yuku-android-util/source/browse/#git%2FAmbilWarna

  2. Extract the zip file.

  3. Import the library project (AmbilWarna) into workspace as you would do for any other library projects like google play services or actionbarsherlock.

  4. Reference the library in your android project

  5. On Button Click or some action

    AmbilWarnaDialog dialog = new AmbilWarnaDialog(MainActivity.this, Color.RED, new OnAmbilWarnaListener() {
                    @Override
                    public void onOk(AmbilWarnaDialog dialog, int color) {
                            // color is the color selected by the user.
                        mPaint.setColor(color); // set color here
                    }
    
                    @Override
                    public void onCancel(AmbilWarnaDialog dialog) {
                            // cancel was selected by the user
                    }
            });
    
            dialog.show();
    
Raghunandan
  • 132,755
  • 26
  • 225
  • 256
  • After I extract the zip file, it has various folders. I do believe that the one I want is the AmbilWarna. Now, where's the library to import? Also, to import, I did the following in Eclipse: Right Click on my project -> Import -> And now what should I choose? – user2902515 Oct 31 '13 at 11:23
  • @user2902515 import Existing Android code into work space. Browse and select the library project. now deselect all and choose (AmbilWarna) click ok – Raghunandan Oct 31 '13 at 11:25
  • @user2902515 to reference. right click on your project goto properties choose android click add browse and add the library project. Now jump to step 5 – Raghunandan Oct 31 '13 at 11:26
  • that is because you haven't referred to the library project properly and see if it conflicts with other libraries that you used in your project. why use such words restrain from using such words in your future comment – Raghunandan Oct 31 '13 at 11:38
  • Dude, I appreciate your help. But that completly ruined my project. My files disappeared and I cannot insert them again in the project. I have tons of files..I do have backups, but when I try to insert it says already exist althought it doesn't show! – user2902515 Oct 31 '13 at 11:41
  • @user2902515 without knowing the errors i can't help nor any body can help. what are the errors – Raghunandan Oct 31 '13 at 11:42
  • Geez christ I think I manage to get this working. I deleted the entire folder and put the backup files. Then I refreshed the project and everything so far seems working. I'll try to fix this and give another try with what you have told to me, but firstly I'm going to backup what I've done today!! – user2902515 Oct 31 '13 at 11:52
  • @user2902515 back it up so that you don't end up doing the project from scratch again. – Raghunandan Oct 31 '13 at 11:55