package Ġbr . com . iw at aso ftware . bas ick otlin app . activity Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . widget . Toast Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . recyclerview . widget . Divider Item Decoration Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġbr . com . iw at aso ftware . bas ick otlin app . R Ċ import Ġbr . com . iw at aso ftware . bas ick otlin app . activity . add country . Add Country Activity Ċ import Ġbr . com . iw at aso ftware . bas ick otlin app . adapter . Country Adapter Ċ import Ġbr . com . iw at aso ftware . bas ick otlin app . model . Country Ċ import Ġcom . google . android . material . floating action button . Floating ActionButton Ċ import Ġkotlinx . android . synt hetic . main . activity _ main .* Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġval Ġre cyclerView Country Ġ= Ġrv _ country ĊĊĠĠĠĠĠĠĠ Ġval Ġcountry Adapter Ġ= ĠCountry Adapter ( co un tr ys (), Ġthis ) ĊĠĠĠĠĠĠĠ Ġcountry Adapter . on Item Click Ġ= Ġ{ country Ġ-> ĠToast . makeText ( this , Ġ" O Ġp ais Ġeh Ġ" Ġ+ Ġcountry . name , ĠToast . LENGTH _ LONG ). show ()} ĊĠĠĠĠĠĠĠ Ġre cyclerView Country . adapter Ġ= Ġcountry Adapter ĊĠĠĠĠĠĠĠ Ġval Ġlinear LayoutManager Ġ= ĠLinearLayoutManager ( this , ĠLinearLayoutManager . VERTICAL , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġre cyclerView Country . layout Manager Ġ= Ġlinear LayoutManager ĊĠĠĠĠĠĠĠ Ġval Ġdivider Item Decoration Ġ= ĠDiv ider Item Decoration ( re cyclerView Country . context , Ġlinear LayoutManager . orientation ) ĊĠĠĠĠĠĠĠ Ġre cyclerView Country . addItem Decoration ( divider Item Decoration ) ĊĊĠĠĠĠĠĠĠ Ġval Ġfab Add Country Ġ: ĠFloating ActionButton Ġ= Ġfab _ add _ country ĊĠĠĠĠĠĠĠ Ġfab Add Country . setOnClickListener Ġ{ ĠstartActivity ( Intent ( this , ĠAdd Country Activity :: class . java ))} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġco un tr ys Ġ() Ġ: ĠList < Country > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," Br azil "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," A le man ha "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," China "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," It Ã¡ lia "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," Core ia Ġdo ĠSul "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCountry ( R . mip map . ic _ braz il ," J ap Ã£o ")) ĊĠĠĠ Ġ} Ċ } Ċ