@Override public void onLockInteraction(LockInteractionEvent lockInteractionEvent) { if (lockInteractionEvent.shouldLock()) { getView().lockScreen(); } else { getView().unlockScreen(); } }
@Override public void onLockInteraction(LockInteractionEvent event) { // Allow progress indicator to be hidden regardless of the current (non-empty) place boolean emptyPlace = placeManager.getCurrentPlaceRequest().getNameToken() == null; if (!emptyPlace && !event.shouldLock()) { // Use deferred command because some other initialization might happen // right after place transition; therefore we want to hide the loading // indicator only after the browser event loop returns Scheduler.get().scheduleDeferred(() -> hideLoadingIndicator()); } // Set data attribute on body element to indicate the status of the application BodyElement body = Document.get().getBody(); if (event.shouldLock()) { body.setAttribute(APP_STATUS_ATTRIBUTE, APP_STATUS_BUSY); } else { body.setAttribute(APP_STATUS_ATTRIBUTE, APP_STATUS_READY); } }