package Ġshow cases Ċ Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . getValue Ċ import Ġandroidx . compose . runtime . mutable State Of Ċ import Ġandroidx . compose . runtime . setValue Ċ import Ġdev . pet us ka . k atalog . runtime . Show case Ċ import Ġdev . pet us ka . k atalog . runtime . layout . Interactive Show case Ċ import Ġdev . pet us ka . k mdc . button . M DC Button Ċ import Ġdev . pet us ka . k mdc . core . KM DC Internal API Ċ import Ġdev . pet us ka . k mdc . core . domain . Point Ċ import Ġdev . pet us ka . k mdc . menu . surface .* Ċ import Ġdev . pet us ka . k mdc . typography . M DC Body 1 Ċ import Ġsandbox . control . Boolean Control Ċ import Ġsandbox . control . Choice Control Ċ import Ġsandbox . util . Named Block Ċ import Ġsandbox . util . Named Group Ċ Ċ private Ġclass ĠM DC Menu Surface VM Ġ{ ĊĠ Ġvar Ġanchor Corner Ġby Ġmutable State Of ( Corner . BOTTOM _ START ) ĊĠ Ġvar Ġfull Width Ġby Ġmutable State Of ( true ) ĊĠ Ġvar Ġfixed Ġby Ġmutable State Of ( false ) ĊĠ Ġvar Ġquick Open Ġby Ġmutable State Of ( false ) ĊĠ Ġvar Ġho isted Ġby Ġmutable State Of ( false ) ĊĠ Ġvar Ġrestore Focus On Close Ġby Ġmutable State Of ( false ) ĊĊĠ Ġvar Ġopen 1 Ġby Ġmutable State Of ( false ) ĊĠ Ġvar Ġopen 2 Ġby Ġmutable State Of ( false ) Ċ } Ċ Ċ @ Composable Ċ @ Show case ( id Ġ= Ġ" M DC Menu Surface ") Ċ fun ĠM DC Menu Surface () Ġ= ĠInteractive Show case ( ĊĠ ĠviewModel Ġ= Ġ{ ĠM DC Menu Surface VM () Ġ}, ĊĠ Ġcontrols Ġ= Ġ{ ĊĠĠĠ ĠChoice Control ( ĊĠĠĠĠĠ Ġtitle Ġ= Ġ" Anchor ĠCor ner ", ĊĠĠĠĠĠ Ġoptions Ġ= Ġmap Of ( ĊĠĠĠĠĠĠĠ Ġ" TOP _ LEFT " Ġto ĠCor ner . TOP _ LEFT , ĊĠĠĠĠĠĠĠ Ġ" TOP _ RIGHT " Ġto ĠCor ner . TOP _ RIGHT , ĊĠĠĠĠĠĠĠ Ġ" BOTTOM _ LEFT " Ġto ĠCor ner . BOTTOM _ LEFT , ĊĠĠĠĠĠĠĠ Ġ" BOTTOM _ RIGHT " Ġto ĠCor ner . BOTTOM _ RIGHT , ĊĠĠĠĠĠĠĠ Ġ" TOP _ START " Ġto ĠCor ner . TOP _ START , ĊĠĠĠĠĠĠĠ Ġ" TOP _ END " Ġto ĠCor ner . TOP _ END , ĊĠĠĠĠĠĠĠ Ġ" BOTTOM _ START " Ġto ĠCor ner . BOTTOM _ START , ĊĠĠĠĠĠĠĠ Ġ" BOTTOM _ END " Ġto ĠCor ner . BOTTOM _ END , ĊĠĠĠĠĠ Ġ), ĊĠĠĠĠĠ Ġselected Ġ= Ġ:: anchor Corner ĊĠĠĠ Ġ) ĊĠĠĠ ĠBoolean Control (" Full ĠWidth ", Ġ:: full Width ) ĊĠĠĠ ĠBoolean Control (" Fixed ", Ġ:: fixed ) ĊĠĠĠ ĠBoolean Control (" Quick ĠOpen ", Ġ:: quick Open ) ĊĠĠĠ ĠBoolean Control (" Ho isted ", Ġ:: ho isted ) ĊĠĠĠ ĠBoolean Control (" Restore ĠFocus Ġon ĠClose ", Ġ:: restore Focus On Close ) ĊĠĠĠ ĠNamed Group (" Absolute ") Ġ{ ĊĠĠĠĠĠ ĠBoolean Control (" Open ", Ġ:: open 1 ) ĊĠĠĠ Ġ} ĊĠĠĠ ĠNamed Group (" An ch ored ") Ġ{ ĊĠĠĠĠĠ ĠBoolean Control (" Open ", Ġ:: open 2 ) ĊĠĠĠ Ġ} ĊĠ Ġ}, Ċ ) Ġ{ ĊĠ ĠNamed Block (" Absolute ") Ġ{ ĊĠĠĠ ĠM DC Menu Surface ( ĊĠĠĠĠĠ Ġopen Ġ= Ġopen 1 , ĊĠĠĠĠĠ Ġfull Width Ġ= Ġfull Width , ĊĠĠĠĠĠ Ġfixed Ġ= Ġfixed , ĊĠĠĠĠĠ Ġanchor Corner Ġ= Ġanchor Corner , ĊĠĠĠĠĠ Ġquick Open Ġ= Ġquick Open , ĊĠĠĠĠĠ Ġho isted Ġ= Ġho isted , ĊĠĠĠĠĠ Ġrestore Focus On Close Ġ= Ġrestore Focus On Close , ĊĠĠĠĠĠ Ġabsolute Position Ġ= ĠPoint ( 0 . 0 , Ġ 0 . 0 ), ĊĠĠĠĠĠ Ġattrs Ġ= Ġ{ ĊĠĠĠĠĠĠĠ Ġregister Events () ĊĠĠĠĠĠĠĠ Ġon Closed Ġ{ Ġopen 1 Ġ= Ġfalse Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠ ĠM DC Body 1 (" Menu ĠContent ...") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĠ Ġ@ Opt In ( KM DC Internal API :: class ) ĊĠ ĠNamed Block (" An ch ored ") Ġ{ ĊĠĠĠ ĠM DC Menu Surface Anchor ( attrs Ġ= Ġ{ ĊĠĠĠĠĠ Ġstyle Ġ{ ĊĠĠĠĠĠĠĠ Ġproperty (" width ", Ġ" fit - content ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) Ġ{ ĊĠĠĠĠĠ ĠM DC Button ( ĊĠĠĠĠĠĠĠ Ġtext Ġ= Ġ" Anchor ", ĊĠĠĠĠĠĠĠ Ġattrs Ġ= Ġ{ ĊĠĠĠĠĠĠĠĠĠ ĠonClick Ġ{ Ġopen 2 Ġ= Ġ! open 2 Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ ĠM DC Menu Surface ( ĊĠĠĠĠĠĠĠ Ġopen Ġ= Ġopen 2 , ĊĠĠĠĠĠĠĠ Ġfull Width Ġ= Ġfull Width , ĊĠĠĠĠĠĠĠ Ġfixed Ġ= Ġfixed , ĊĠĠĠĠĠĠĠ Ġanchor Corner Ġ= Ġanchor Corner , ĊĠĠĠĠĠĠĠ Ġquick Open Ġ= Ġquick Open , ĊĠĠĠĠĠĠĠ Ġho isted Ġ= Ġho isted , ĊĠĠĠĠĠĠĠ Ġrestore Focus On Close Ġ= Ġrestore Focus On Close , ĊĠĠĠĠĠĠĠ Ġattrs Ġ= Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġregister Events () ĊĠĠĠĠĠĠĠĠĠ Ġon Closed Ġ{ Ġopen 2 Ġ= Ġfalse Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ ĠM DC Body 1 (" Menu ĠContent ...") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ private Ġfun ĠM DC Menu Surface Attrs Scope . register Events () Ġ{ ĊĠ Ġon Opened Ġ{ Ġconsole . log (" M DC Menu Surface # on Opened ", Ġit . detail ) Ġ} ĊĠ Ġon Closing Ġ{ Ġconsole . log (" M DC Menu Surface # on Closing ", Ġit . detail ) Ġ} ĊĠ Ġon Closed Ġ{ Ġconsole . log (" M DC Menu Surface # on Closed ", Ġit . detail ) Ġ} Ċ } Ċ