Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of creating a complex custom AlertDialog.

The project contains examples of working with color. Convert ARGB color to its HSV components to obtain hue, saturation, and value. The round cursor changes color depending on the brightness of the color.

PaletteDialog1 PaletteDialog2

The libs folder contains the compiled PaletteDialog.aar library.

Dependencies:

implementation(files("libs/PaletteDialog.aar"))

or

implementation("io.github.uratera:palette_dialog:1.0.2")

Usage

Kotlin

private fun openDialog() {
    PaletteDialog(this, myColor)
        .setOnClickListener {
            myColor = it
        }
}

If necessary, you can change the color of the buttons and the color of the button text.

private fun openDialog() {
    val dialog = PaletteDialog(this, myColor)
    dialog.buttonOkColor = -2490390
    dialog.textOkColor = -16546298
    dialog.buttonCancelColor = -6426
    dialog.textCancelColor = -3012857
    dialog.setOnClickListener {
        myColor = it
    }
}

Java

private void openDialog() {
    PaletteDialog dialog = new PaletteDialog(this, myColor);
    dialog.setOnClickListener(color -> {
        myColor = color;
        return null;
    });
}

About

Example of creating a complex custom AlertDialog.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages