Giter Club home page Giter Club logo

android-color-picker's People

Contributors

chiralcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-color-picker's Issues

One color picker - border

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!

Rotation cause canvas corruption

when ColorPickerDialog is visible and screen is rotated, older view is not cleared and new view is drawn. and the final view is corrupted

Preview for PreferenceCategory

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.

How to add continuous output?

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.

add in android studio

can you release a new version of this project to use it easily in android studio ๐Ÿ‘ ?

I cant add this to ScrollView

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

Getting the selected color

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!?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.