/ Color

Color chooser dialog library for android

Color chooser dialog library for android

color chooser

Color chooser dialog library for android.

ScreenShots

1 2 3
4 5 6
7 8 9

How to use

Download from jCenter. Add dependencies, such as the following.

repositories {
    jcenter()
}
dependencies {
    implementation 'net.mm2d:color-chooser:0.1.3'
}

To show dialog. On FragmentActivity or Fragment

ColorChooserDialog.show(
    this,         // Fragment or FragmentActivity
    REQUEST_CODE, // request code for receive result
    initialColor, // initial color
    true          // false, if alpha is not needed
)

To receive result. Implement ColorChooserDialog.Callback to Activity or Fragment

class MainActivity : AppCompatActivity(), ColorChooserDialog.Callback {
    override fun onColorChooserResult(requestCode: Int, resultCode: Int, color: Int) {
        if (requestCode != REQUEST_CODE || resultCode != Activity.RESULT_OK) return
        // use color
    }
}

GitHub