chiralcode / android-color-picker Goto Github PK
View Code? Open in Web Editor NEWColor picker for Android
License: Apache License 2.0
Color picker for Android
License: Apache License 2.0
It works in linearlayout, but when I ad it to ScrollView my app crashes.
04-19 16:24:16.542: E/AndroidRuntime(10188): java.lang.RuntimeException: Unable to start activity ComponentInfo{cro.marin.colorwallpaper/cro.marin.colorwallpaper.WallpaperColor}: java.lang.ClassCastException: android.widget.ScrollView
I want to set the position of cursor when first open picker
Is there a way to modify the color picker so that it continuously outputs a color value as it is changed? Similar to the function onProgressChanged that a seekBar uses.
Your code was used as base for the color picker of this game:
https://github.com/dftec-es/planetcon/tree/master/src/com/dftec/planetcon/settings
I just wanted to thank you for sharing it.
Hi, In your preview you used java code to show how to get the selected color. I am using c# with Xamarin.Android. Can you give me an example of how I can get the selected color? I can't figure it out!?
when ColorPickerDialog is visible and screen is rotated, older view is not cleared and new view is drawn. and the final view is corrupted
Is there a way to hide the alpha bar?
can you release a new version of this project to use it easily in android studio ๐ ?
Originally, I wanted to fork the project and create a pull request. Since there were unstaged files directly from the beginning (after git pull from my work), I will write the change here. I added a preview to the ColorPickerPreference
, where the color will be drawn in a Rectangle on the right side of the category.
Simply add this stuff to the ColorPickerPreference
class:
private LinearLayout preview;
@Override
protected View onCreateView(ViewGroup parent) {
final LinearLayout view = (LinearLayout) super.onCreateView(parent);
preview = new LinearLayout(getContext());
preview.setLayoutParams(new LinearLayout.LayoutParams(60, 60));
preview.setBackgroundColor(selectedColor);
preview.invalidate();
view.addView(preview);
return view;
}
Overrite the onDialogClosed function with:
@Override
protected void onDialogClosed(boolean positiveResult) {
if (positiveResult && shouldPersist()) {
if (callChangeListener(colorPickerView.getColor())) {
selectedColor = colorPickerView.getColor();
persistInt(selectedColor);
preview.setBackgroundColor(selectedColor);
}
}
}
You may want to merge this, you may not. It's up to you. I just felt the need to share it, since I find it kinda nice to see the color in a little preview.
I am testing with the one color picker wich I included into the xml file like:
<com.chiralcode.colorpicker.ColorPicker
android:id="@+id/colorPicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
I removed the outer circle because I want to control the brightness with an seekbar.
It is working nicely but there is one problem.
If i want to set the color to one color that is shown near the border (every color with full saturation) the "picker" often dont get to the border of the color circle.
Is there a way how I can make the "picker" follow my finger on the closest position in the circle even If I left the circle?
I mean: If I chose white and slide to the left side of the circle (where red is) and stay with the finger on the screen, then moving outside the circle and slide outside the circle to the right side (where azur blue is). Is there a way to let the "picker" follow my finger on the color closest to the position of my finger?
Thank you a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.