QuadFlask / colorpicker

🍭color picker for android
1.22k stars 219 forks source link

How can I use this code without a dialog box, just in activity? #100

Open Sterkhov96 opened 6 years ago

Sterkhov96 commented 6 years ago

How can I use this code without a dialog box, just in activity

Shadow1356 commented 6 years ago

Simply add this to your XML: <com.flask.colorpicker.ColorPickerView android:id="@+id/static_color_picker" android:layout_width="match_parent" android:layout_height="700dp" android:layout_marginLeft="20dp" app:alphaSlider="true" app:lightnessSlider="true" app:wheelType="CIRCLE" />

Then in your Java activity, colorPicker = findViewById(R.id.static_color_picker); Then you can add a Listener to it: colorPicker.addOnColorSelectedListener(colorListener()); And do whatever you want in the listener.

Shadow1356 commented 6 years ago

There should be some newlines in that xml, but Github won't let me :(

Hopefully you get the idea.