package Ġcom . ks lim web . test fac em atch ing . utils Ċ Ċ import Ġandroid . annotation . Suppress Lint Ċ import Ġandroid . app . Activity Ċ import Ġandroid . media . Media Action Sound Ċ import Ġandroid . os . Count Down Timer Ċ import Ġandroid . util . Log Ċ import Ġandroidx . camera . core . Video Capture Ċ import Ġkotlinx . android . synt hetic . main . activity _ camera _ x .* Ċ import Ġcom . ks lim web . test fac em atch ing . R ĊĊ Ċ open Ġclass ĠTimer ( ĊĠĠĠ Ġprivate Ġval Ġmillis In Future : ĠLong , ĊĠĠĠ Ġprivate Ġval Ġcount Down Interval : ĠLong , ĊĠĠĠ Ġprivate Ġval Ġactivity : ĠActivity , ĊĠĠĠ Ġprivate Ġval Ġvideo Capture : ĠVideo Capture ) ĊĠĠĠ Ġ: ĠCount Down Timer ( millis In Future , Ġcount Down Interval ) Ġ{ ĊĊĠĠĠ Ġ@ Suppress Lint (" Restricted Api ") ĊĠĠĠ Ġoverride Ġfun Ġon Finish () Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity . capture _ button . setBackground Resource ( R . drawable . ic _ sh utter _ video ) ĊĠĠĠĠĠĠĠ ĠMedia Action Sound (). play ( Media Action Sound . STOP _ VIDEO _ RECORD ING ) ĊĠĠĠĠĠĠĠ Ġvideo Capture . stop Recording () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Tick ( millis Until Finished : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsecond Ġ= Ġ(( millis In Future Ġ- Ġmillis Until Finished ) Ġ/ Ġcount Down Interval ). toInt () ĊĠĠĠĠĠĠĠ Ġval Ġformatted Timer Ġ= Ġactivity . resources . getString ( R . string . timer _ message , Ġsecond ) ĊĠĠĠĠĠĠĠ Ġactivity . timer . text Ġ= Ġformatted Timer ĊĠĠĠĠĠĠĠ ĠLog . d (" Count Up ", Ġsecond . toString ()) ĊĠĠĠ Ġ} Ċ }