package Ġcom . shop app . ui . item Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . support . constraint . Constraint Layout Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup . LayoutParams . MATCH _ PARENT Ċ import Ġandroid . view . ViewGroup . LayoutParams . WRAP _ CONTENT Ċ import Ġcom . shop app . gateway . entity . Address Ċ import Ġcom . shop app . R Ċ import Ġcom . shop app . ui . address . base . adapter . Address ListAdapter Ċ import Ġkotlinx . android . synt hetic . main . item _ address . view .* Ċ Ċ @ Suppress (" Le aking This ") Ċ open Ġclass ĠAddress Item ( context : ĠContext ) Ġ: ĠConstraint Layout ( context ) Ġ{ ĊĊĠĠĠ Ġvar Ġaction Listener : ĠAddress ListAdapter . ActionButton Listener ? Ġ= Ġnull ĊĠĠĠ Ġprotected Ġlateinit Ġvar Ġaddress : ĠAddress ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠView . inflate ( context , Ġget Layout Id (), Ġthis ) ĊĠĠĠĠĠĠĠ Ġlayout Params Ġ= ĠLayout Params ( MATCH _ PARENT , ĠWR AP _ CONTENT ) ĊĠĠĠĠĠĠĠ Ġset BackgroundColor ( Color . WHITE ) ĊĠĠĠĠĠĠĠ Ġedit Button . setOnClickListener Ġ{ Ġaction Listener ?. on Edit Button Clicked ( address ) Ġ} ĊĠĠĠĠĠĠĠ Ġdelete Button . setOnClickListener Ġ{ Ġaction Listener ?. onDelete Button Clicked ( address ) Ġ} ĊĠĠĠĠĠĠĠ Ġdefault Button . setOnClickListener Ġ{ Ġaction Listener ?. on Default Button Clicked ( address ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġopen Ġfun Ġget Layout Id () Ġ= ĠR . layout . item _ address ĊĊĠĠĠ Ġopen Ġfun Ġset Address ( address : ĠAddress , Ġdefault Address : ĠAddress ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . address Ġ= Ġaddress ĊĠĠĠĠĠĠĠ Ġaddress Content . set Address ( address ) ĊĠĠĠĠĠĠĠ Ġval Ġis Default Ġ= Ġaddress . id Ġ== Ġdefault Address ?. id Ġ|| Ġaddress Ġ== Ġdefault Address ĊĠĠĠĠĠĠĠ Ġdelete Button . isEnabled Ġ= Ġ! is Default ĊĠĠĠĠĠĠĠ Ġdefault Button . isEnabled Ġ= Ġ! is Default ĊĠĠĠ Ġ} Ċ }