public void show ( final Toast toast , float timeSec ) { Table toastMainTable = toast . getMainTable ( ) ; if ( toastMainTable . getStage ( ) != null ) { remove ( toast ) ; } toasts . add ( toast ) ; toast . setToastManager ( this ) ; toast . fadeIn ( ) ; toastMainTable . pack ( ) ; root . addActor ( toastMainTable ) ; updateToastsPositions ( ) ; if ( timeSec > 0 ) { Timer . Task fadeOutTask = new Timer . Task ( ) { @ Override public void run ( ) { toast . fadeOut ( ) ; timersTasks . remove ( toast ) ; } } ; timersTasks . put ( toast , fadeOutTask ) ; Timer . schedule ( fadeOutTask , timeSec ) ; } }
Displays toast . Toast will be displayed for given amount of seconds .