private void updateMenuItems ( boolean isGpsStarted , boolean isRecording ) { boolean hasTrack = listView != null && listView . getCount ( ) != 0 ; if ( startGpsMenuItem != null ) { startGpsMenuItem . setVisible ( ! isRecording ) ; if ( ! isRecording ) { startGpsMenuItem . setTitle ( isGpsStarted ? R . string . menu_stop_gps : R . string . menu_start_gps ) ; startGpsMenuItem . setIcon ( isGpsStarted ? R . drawable . ic_menu_stop_gps : R . drawable . ic_menu_start_gps ) ; TrackIconUtils . setMenuIconColor ( startGpsMenuItem ) ; } } if ( playMultipleItem != null ) { playMultipleItem . setVisible ( hasTrack ) ; } if ( syncNowMenuItem != null ) { syncNowMenuItem . setTitle ( driveSync ? R . string . menu_sync_now : R . string . menu_sync_drive ) ; } if ( aggregatedStatisticsMenuItem != null ) { aggregatedStatisticsMenuItem . setVisible ( hasTrack ) ; } if ( exportAllMenuItem != null ) { exportAllMenuItem . setVisible ( hasTrack && ! isRecording ) ; } if ( importAllMenuItem != null ) { importAllMenuItem . setVisible ( ! isRecording ) ; } if ( deleteAllMenuItem != null ) { deleteAllMenuItem . setVisible ( hasTrack && ! isRecording ) ; } }
Updates the menu items .