package Ġcom . ger ard br ad sh aw . example app Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġcom . ger ard br ad sh aw . color picker library . views . Abstract Color Picker View Ċ Ċ class ĠComp act View Activity Ġ: ĠAppCompatActivity (), ĠAbstract Color Picker View . Color Changed Listener Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġpicker : ĠAbstract Color Picker View ĊĠ Ġprivate Ġlateinit Ġvar Ġlistener : ĠView ĊĊĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠ ĠsetContentView ( R . layout . activity _ example _ compact _ picker ) ĊĊĠĠĠ Ġpicker Ġ= ĠfindViewById ( R . id . example _ compact _ picker ) ĊĠĠĠ Ġlistener Ġ= ĠfindViewById ( R . id . example _ listener ) ĊĊĠĠĠ Ġpicker . setOn Color Selected Listener ( this ) ĊĊĠĠĠ Ġupdate Listener Color ( picker . getCurrent Color ()) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Color Changed ( color : ĠInt ) Ġ{ ĊĠĠĠ Ġupdate Listener Color ( color ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġupdate Listener Color ( color : ĠInt ) Ġ{ ĊĠĠĠ Ġlistener . setTag ( R . id . color _ picker _ library _ color _ tag , Ġcolor ) ĊĠĠĠ Ġlistener . set BackgroundColor ( color ) ĊĠ Ġ} Ċ }