color chooser
Color chooser dialog library for android.
ScreenShots
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
}
}