import { topmost } from 'ui/frame' ; import { ActionItem , ActionItems } from 'ui/action-bar' ; declare var UIBarStyle ; export class ActionBarUtil { public static SET_TITLE ( title ) { var actionBar = topmost ( ) . currentPage . actionBar ; actionBar . title = title ; } public static ADD_BUTTON ( button ) { topmost ( ) . currentPage . actionBar . actionItems . addItem ( button ) ; } public static HIDE_BACK_BUTTON ( ) { if ( topmost ( ) . ios ) { topmost ( ) . ios . controller . visibleViewController . navigationItem . setHidesBackButtonAnimated ( true , false ) ; } } public static EMPTY_ITEMS ( ) { var actionBar = topmost ( ) . currentPage . actionBar ; var actionItems = actionBar . actionItems . getItems ( ) ; actionItems . forEach ( ( item ) => { actionBar . actionItems . removeItem ( item ) ; } ) ; } public static STATUSBAR_STYLE ( style ) { if ( topmost ( ) . ios ) { let navigationBar = topmost ( ) . ios . controller . navigationBar ; navigationBar . barStyle = style ; } } }