package Ġcom . do br uc ali . product 2 4 . utils Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . content . Context Ċ import Ġandroid . view . View Ċ import Ġandroid . view . input method . Input Method Manager Ċ import Ġandroid . widget . Toast Ċ Ċ fun ĠActivity . hide Keyboard () Ġ{ ĊĠĠĠ Ġif Ġ( current Focus Ġ== Ġnull ) ĠView ( this ) Ġelse Ġcurrent Focus ?. let Ġ{ Ġhide Keyboard ( it ) Ġ} Ċ } Ċ Ċ fun ĠContext . hide Keyboard ( view : ĠView ) Ġ{ ĊĠĠĠ Ġval Ġinput Method Manager Ġ= Ġget System Service ( Activity . INPUT _ METHOD _ SERVICE ) Ġas ĠInput Method Manager ĊĠĠĠ Ġinput Method Manager . hide Soft Input From Window ( view . window Token , Ġ 0 ) Ċ } Ċ Ċ fun ĠContext . toast ( message : ĠCharSequence ) Ġ= ĊĠĠĠ ĠToast . makeText ( this , Ġmessage , ĠToast . LENGTH _ LONG ). show ()