package Ġcom . mate mat ik . em re 4 . a 1 0 ad md amate mat ik Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Toast Ċ import Ġcom . example . em re 4 . a 1 0 ad md amate mat ik . Build Config Ċ import Ġcom . example . em re 4 . a 1 0 ad md amate mat ik . K ol ay M ate mat ik Ċ import Ġcom . example . em re 4 . a 1 0 ad md amate mat ik . R Ċ import Ġcom . google . android . gms . ads . Ad Request Ċ import Ġcom . google . android . gms . ads . Mobile Ads Ċ import Ġcom . google . android . gms . ads . reward . Reward Item Ċ Ċ import Ġcom . google . android . gms . ads . reward . Rew arded Video Ad Ċ import Ġcom . google . android . gms . ads . reward . Rew arded Video Ad Listener Ċ Ċ import Ġkotlinx . android . synt hetic . main . activity _ re kl am 2 .* Ċ Ċ class Ġre kl am Ġ: ĠAppCompatActivity (), ĠRew arded Video Ad Listener Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Rew arded Video Ad : ĠRew arded Video Ad ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ re kl am 2 ) ĊĊĊĊĠĠĠĠĠĠĠ ĠMobile Ads . initialize ( this , Ġ" ca - app - pub - 6 5 3 7 1 9 0 1 0 3 0 1 4 6 3 9 ~ 4 5 4 9 1 1 7 0 0 5 ") ĊĠĠĠĠĠĠĠ Ġ// ĠUse Ġan Ġactivity Ġcontext Ġto Ġget Ġthe Ġre warded Ġvideo Ġinstance . ĊĠĠĠĠĠĠĠ Ġm Rew arded Video Ad Ġ= ĠMobile Ads . get Rew arded Video Ad Instance ( this ) ĊĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . re warded Video Ad Listener Ġ= Ġthis ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġload Rew arded Video Ad () ĊĊĊĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġload Rew arded Video Ad () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . load Ad (" ca - app - pub - 6 5 3 7 1 9 0 1 0 3 0 1 4 6 3 9 / 3 6 6 0 3 6 5 6 8 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠAd Request . Builder (). build ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded ( reward : ĠRew ard Item ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded ! Ġcurrency : Ġ${ reward . type } Ġamount : Ġ${ reward . amount }", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠToast . LENGTH _ SHORT ). show () ĊĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠRew ard Ġthe Ġuser . ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Ad Left Application () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded Video Ad Left Application ", ĠToast . LENGTH _ SHORT ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Ad Failed To Load ( errorCode : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" internet iniz i Ġkont rol Ġed iniz .", ĠToast . LENGTH _ SHORT ). show () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . show () ĊĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Ad Loaded () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded Video Ad Loaded ", ĠToast . LENGTH _ SHORT ). show () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . show () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġt ik l aaa . text =" nol uy ok Ġmk " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġt ik l aaa . set BackgroundColor ( Color . YELLOW ) ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Ad Opened () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded Video Ad Opened ", ĠToast . LENGTH _ SHORT ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Started () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded Video Started ", ĠToast . LENGTH _ SHORT ). show () ĊĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Completed () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( this , Ġ" on Rew arded Video Completed ", ĠToast . LENGTH _ SHORT ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Rew arded Video Ad Closed () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġload Rew arded Video Ad () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Pause () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Pause () ĊĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . pause ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . resume ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy () ĊĠĠĠĠĠĠĠ Ġm Rew arded Video Ad . destroy ( this ) ĊĊĊĠĠĠ Ġ} Ċ Ċ }