package Ġw ang . is am . lib ar ay . kotlin . ext Ċ Ċ import Ġandroid . app . Fragment Ċ import Ġandroid . content . Context Ċ import Ġandroid . support . annotation . Int Def Ċ import Ġandroid . support . annotation . String Res Ċ import Ġandroid . widget . Toast Ċ Ċ //@ Document ed Ċ //@ Int Def { Toast . LENGTH _ LONG , Toast } Ċ //@ Retention ( RetentionPolicy . SOURCE ) Ċ // public Ġ@ interface ĠToast Dur at g ion {} Ċ private Ġobject ĠToast Object Ġ{ ĊĠĠĠ Ġ@ Int Def ( Toast . LENGTH _ LONG , ĠToast . LENGTH _ SHORT ) ĊĠĠĠ Ġ@ Retention ( Annotation Retention . SOURCE ) ĊĠĠĠ Ġannotation Ġclass ĠToast Duration Ċ } Ċ Ċ fun ĠContext . toast ( text : ĠCharSequence , Ġ@ Toast Object . Toast Duration Ġduration : ĠInt Ġ= ĠToast . LENGTH _ SHORT ) Ġ{ ĊĠĠĠ ĠToast . makeText ( this , Ġtext , Ġduration ). show () Ċ } Ċ fun ĠFragment . toast ( text : ĠCharSequence , Ġ@ Toast Object . Toast Duration Ġduration : ĠInt Ġ= ĠToast . LENGTH _ SHORT ) Ġ{ ĊĠĠĠ Ġthis . activity . toast ( text , duration ) Ċ } Ċ Ċ fun ĠContext . toast (@ String Res Ġtext : ĠInt , Ġ@ Toast Object . Toast Duration Ġduration : ĠInt Ġ= ĠToast . LENGTH _ SHORT ) Ġ{ ĊĠĠĠ ĠToast . makeText ( this , Ġtext , Ġduration ). show () Ċ } Ċ fun ĠFragment . toast (@ String Res Ġtext : ĠInt , Ġ@ Toast Object . Toast Duration Ġduration : ĠInt Ġ= ĠToast . LENGTH _ SHORT ) Ġ{ ĊĠĠĠ Ġthis . activity . toast ( text , duration ) Ċ } Ċ