package Ġcom . sch ib st ed . sp ain . bar ista . interaction Ċ Ċ import Ġandroid . support . annotation . Id Res Ċ import Ġandroid . support . v 4 . widget . Swipe Refresh Layout Ċ Ċ import Ġandroid . support . test . espress o . Esp ress o . on View Ċ import Ġandroid . support . test . espress o . matcher . View Matchers . isAssignableFrom Ċ import Ġandroid . support . test . espress o . matcher . View Matchers . with Id Ċ import Ġcom . sch ib st ed . sp ain . bar ista . internal . view action . Swipe Refresh Actions . pull To Refresh Ċ Ċ object ĠBar ista Swipe Refresh Interactions Ġ{ ĊĊĠĠĠ Ġ@ Jvm Static ĊĠĠĠ Ġ@ Jvm Over loads ĊĠĠĠ Ġfun Ġrefresh (@ Id Res Ġid : ĠInt ? Ġ= Ġnull ) Ġ= Ġwhen Ġ( id ) Ġ{ ĊĠĠĠĠĠĠĠ Ġnull Ġ-> Ġon View ( isAssignableFrom ( Swipe Refresh Layout :: class . java )). perform ( pull To Refresh ()) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġon View ( with Id ( id )). perform ( pull To Refresh ()) ĊĠĠĠ Ġ} Ċ } Ċ