package Ġdev . pet us ka . k mdc . segment ed . button Ċ Ċ import Ġdev . pet us ka . k mdc . core . M DC Attrs Dsl Ċ import Ġdev . pet us ka . k mdc . core . M DC EventListener Ċ import Ġdev . pet us ka . k mdc . core . add M dc EventListener Ċ Ċ public Ġexternal Ġinterface ĠM DC Segment ed Button Event Detail Ġ{ ĊĠ Ġpublic Ġval Ġindex : ĠNumber ĊĠ Ġpublic Ġval Ġselected : ĠBoolean ĊĠ Ġpublic Ġval Ġsegment Id : ĠString ? Ċ } Ċ Ċ /** Ċ Ġ* Ġ[ JS ĠAPI ]( https :// github . com / material - components / material - components - web / tree / v 1 4 . 0 . 0 / packages / mdc - segment ed - button ) Ċ Ġ*/ Ċ @ M DC Attrs Dsl Ċ public Ġfun ĠM DC Segment ed Button Attrs Scope . on Selected ( listener : ĠM DC EventListener < M DC Segment ed Button Event Detail >) Ġ{ ĊĠ Ġadd M dc EventListener (" selected ", Ġlistener ) Ċ } Ċ Ċ /** Ċ Ġ* Ġ[ JS ĠAPI ]( https :// github . com / material - components / material - components - web / tree / v 1 4 . 0 . 0 / packages / mdc - segment ed - button ) Ċ Ġ*/ Ċ @ M DC Attrs Dsl Ċ public Ġfun ĠM DC Segment ed Button Attrs Scope . onChange ( listener : ĠM DC EventListener < M DC Segment ed Button Event Detail >) Ġ{ ĊĠ Ġadd M dc EventListener (" change ", Ġlistener ) Ċ } Ċ Ċ /** Ċ Ġ* Ġ[ JS ĠAPI ]( https :// github . com / material - components / material - components - web / tree / v 1 4 . 0 . 0 / packages / mdc - segment ed - button ) Ċ Ġ*/ Ċ @ M DC Attrs Dsl Ċ public Ġfun ĠM DC Segment ed Button Segment Attrs Scope . on Selected ( listener : ĠM DC EventListener < M DC Segment ed Button Event Detail >) Ġ{ ĊĠ Ġadd M dc EventListener (" selected ", Ġlistener ) Ċ } Ċ Ċ /** Ċ Ġ* Ġ[ JS ĠAPI ]( https :// github . com / material - components / material - components - web / tree / v 1 4 . 0 . 0 / packages / mdc - segment ed - button ) Ċ Ġ*/ Ċ @ M DC Attrs Dsl Ċ public Ġfun ĠM DC Segment ed Button Segment Attrs Scope . on Clicked ( listener : ĠM DC EventListener < Number >) Ġ{ ĊĠ Ġadd M dc EventListener (" click ", Ġlistener ) Ċ } Ċ