Color Pickers from Google
There are a lot of Color Pickers available, some very nice.
The most difficult thing is to know that there are and where they are.
Here a first collection, written by Google.
Checkout in github repository last version and last document about usage.
Google Stock Calendar
You can find source in Color Picker repository.
You can download and use it
It is very simple to use. You have just to provide an array of colors.
DashClock Color Picker
Dashclock by Roman Nurik is an inexhaustible source of knowledge.
You can find an interesting implementation of Dashclock ColorPreference.
You can download and use it
It is very simple to use.You need just a preferences file.
I've extracted this Dialog in a separate class, removing the dependencies with Preferences.
You can find an example in ColorPickerDialogDash source. Also in this case, you should provide an array of colors as in previous example.
You just have to use them.
You can get code from GitHub:
The most difficult thing is to know that there are and where they are.
Here a first collection, written by Google.
Checkout in github repository last version and last document about usage.
Google Stock Calendar
You can find source in Color Picker repository.
You can download and use it
It is very simple to use. You have just to provide an array of colors.
ColorPickerDialog colorcalendar = ColorPickerDialog.newInstance( R.string.color_picker_default_title, mColor, 0, 5, Utils.isTablet(this)? ColorPickerDialog.SIZE_LARGE : ColorPickerDialog.SIZE_SMALL); colorcalendar.show(getFragmentManager(),"cal");
mColor
is an array of Color.public static int[] colorChoice(Context context){ int[] mColorChoices=null; String[] color_array = context.getResources(). getStringArray(R.array.default_color_choice_values); if (color_array!=null && color_array.length>0) { mColorChoices = new int[color_array.length]; for (int i = 0; i < color_array.length; i++) { mColorChoices[i] = Color.parseColor(color_array[i]); } } return mColorChoices; }where
default_color_choice_values
is defined in res/colors.xmlI think that Google Keep uses the same color picker.- #33b5e5
- #aa66cc
- #99cc00
- #ffbb33
- #ff4444
- #0099cc
- #9933cc
- #669900
- #ff8800
- #cc0000
- #ffffff
- #eeeeee
- #cccccc
- #888888
DashClock Color Picker
Dashclock by Roman Nurik is an inexhaustible source of knowledge.
You can find an interesting implementation of Dashclock ColorPreference.
You can download and use it
It is very simple to use.You need just a preferences file.
ColorPreference
is based on a DialogFragment.I've extracted this Dialog in a separate class, removing the dependencies with Preferences.
You can find an example in ColorPickerDialogDash source. Also in this case, you should provide an array of colors as in previous example.
//Custom Dialog extracted from ColorPreference ColorPickerDialogDash colordashfragment = ColorPickerDialogDash.newInstance( R.string.color_picker_default_title, mColor, mSelectedColorDash1,5); //Implement listener to get selected color value colordashfragment.setOnColorSelectedListener( new ColorPickerDialogDash.OnColorSelectedListener(){ @Override public void onColorSelected(int color) { mSelectedColorDash1=color; item.colorSquare=color; mAdapter.notifyDataSetChanged(); } }); colordashfragment.show(getFragmentManager(), "dash");
You just have to use them.
You can get code from GitHub:
Comments
Post a Comment