package Ġcom . example . clock widget pack Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . widget . Button Ċ import Ġandroid . widget . EditText Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġcom . example . clock widget pack . Custom Views . AM illion Clock . AM illion Clock Compound View Ċ import Ġcom . example . clock widget pack . Custom Views . AM illion Clock . Analog Clock View Ċ import Ġcom . example . clock widget pack . utils . System Clock Provider Ċ import Ġcom . example . clock widget pack . utils . Time Util ĊĊ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġhour One Ġ: ĠAM illion Clock Compound View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġhour Two Ġ: ĠAM illion Clock Compound View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġminute One Ġ: ĠAM illion Clock Compound View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġminute Two Ġ: ĠAM illion Clock Compound View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsecond One Ġ: ĠAM illion Clock Compound View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsecond Two Ġ: ĠAM illion Clock Compound View ĊĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġhour One Ġ= ĠfindViewById ( R . id . hour Counter First ) ĊĠĠĠĠĠĠĠ Ġhour Two Ġ= ĠfindViewById ( R . id . hour Counter Second ) ĊĊĠĠĠĠĠĠĠ Ġminute One Ġ= ĠfindViewById ( R . id . minute Counter First ) ĊĠĠĠĠĠĠĠ Ġminute Two Ġ= ĠfindViewById ( R . id . minute Counter Second ) ĊĊĠĠĠĠĠĠĠ Ġsecond One Ġ= ĠfindViewById ( R . id . second Counter First ) ĊĠĠĠĠĠĠĠ Ġsecond Two Ġ= ĠfindViewById ( R . id . second Counter Second ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtimer Ġ Ġ= ĠSystem Clock Provider () ĊĠĠĠĠĠĠĠ Ġtimer . start Timer () ĊĊĊĠĠĠĠĠĠĠ Ġtimer . hour First Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhour One . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġtimer . hour Second Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhour Two . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĊĠĠĠĠĠĠĠ Ġtimer . minute First Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġminute One . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġtimer . minute Second Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġminute Two . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĊĠĠĠĠĠĠĠ Ġtimer . second First Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsecond One . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġtimer . second Second Digit . observe ( this Ġ, ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsecond Two . call Number ( it ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠ Ġ} ĊĊĊĊ Ċ }