package Ġar . edu . ut n . fr ba . mobile . a 2 0 1 9 c 1 . super hero es . ui . cards Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . widget . ImageView Ċ import Ġandroid . widget . TextView Ċ import Ġar . edu . ut n . fr ba . mobile . a 2 0 1 9 c 1 . super hero es . R Ċ import Ġcom . squareup . pic asso . Pic asso Ċ import Ġkotlinx . android . synt hetic . main . activity _ show _ single _ card .* Ċ Ċ class ĠShow Single Card Ġ: ĠAppCompatActivity () Ġ{ ĊĊĊ ĉ override Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ Ċĉ ĉ super . onCreate ( savedInstanceState ) Ċĉ ĉ set ContentView ( R . layout . activity _ show _ single _ card ) Ċĉ ĉ initialize Views () Ċĉ ĉ button Close () ĊĊĊ ĉ } ĊĊĊ ĉ private Ġfun Ġinitialize Views () Ġ{ Ċĉ ĉ // val Ġid Ġ= Ġintent . getString Extra (" id ") Ċĉ ĉ val Ġname Ġ= Ġintent . getString Extra (" name ") Ċĉ ĉ val Ġdescription Ġ= Ġintent . getString Extra (" description ") Ċĉ ĉ val Ġpower Ġ= Ġintent . getString Extra (" power ") Ċĉ ĉ val Ġthumbnail Ġ= Ġintent . getString Extra (" thumbnail ") ĊĊĊĉ ĉ findViewById < TextView >( R . id . textView _ show single card _ name ). apply Ġ{ Ċĉĉ ĉ text Ġ= Ġname Ċĉ ĉ } Ċĉ ĉ findViewById < TextView >( R . id . textView _ show single card _ description ). apply Ġ{ Ċĉĉ ĉ text Ġ= Ġdescription Ċĉ ĉ } Ċĉ ĉ findViewById < TextView >( R . id . textView _ show single card _ power ). apply Ġ{ Ċĉĉ ĉ text Ġ= Ġ" Power : Ġ$ power " Ċĉ ĉ } ĊĊĉ ĉ val ĠimageView Photo Ġ= ĠfindViewById < ImageView >( R . id . image view _ show single card _ photo ) ĊĊĉ ĉ Pic asso . get () Ċĉĉ ĉ . load ( thumbnail ) Ċĉĉ ĉ . resize ( 2 0 0 , Ġ 2 0 0 ) Ċĉĉ ĉ . center Crop () Ċĉĉ ĉ . placeholder ( R . drawable . ic _ super hero ) Ċĉĉ ĉ . error ( R . drawable . ic _ super hero ) Ċĉĉ ĉ . into ( imageView Photo ) Ċ ĉ } ĊĊ ĉ private Ġfun Ġbutton Close () Ġ{ Ċĉ ĉ button _ show single card _ back . setOnClickListener Ġ{ Ċĉĉ ĉ finish () Ċĉ ĉ } Ċ ĉ } Ċ } Ċ