/** * Check the app is exiting * * @param sender The sender */ private void checkAppExit(Object sender) { NavLocation curLocation = navigationManager.getModel().getCurrentLocation(); if (curLocation == null) { navigationManager.postEvent2C(new NavigationManager.Event.OnAppExit(sender)); } }
@Override public String toString() { return "Reason: {" + "newInstance: " + isNewInstance() + ", firstTime: " + isFirstTime() + ", restore: " + isRestored() + ", popOut: " + isPoppedOut() + ", rotate: " + isRotated() + '}'; } }
@Test public void use_method_should_retain_and_release_instance_correctly() throws ProvideException, ProviderConflictException { graph.getRootComponent().register(new DeviceModule()); do_use_method_should_retain_and_release_instance_correctly(); }
@Override public void run() { callback.onCancelled(mayInterruptIfRunning); callback.onFinally(); } });
private void updateToolbar(final NavLocation location) { uiThreadRunner.post(new Runnable() { @Override public void run() { doUpdateNavIcon(location); } }); }
/** * Bind model to this manager * @param sender Who wants to bind it * @param model The model to bind to this manager. CANNOT be NULL otherwise a runtime */ public void bindModel(Object sender, MODEL model) { super.bindModel(model); }
/** * Get the view model the controller is holding. Don't write but only read the model from view. * Should only controller write the model. * * @return Null if the controller doesn't need to get its model saved and restored automatically * when {@link #modelType()} returns null. */ @Override public MODEL getModel() { return super.getModel(); }
/** * Called when the Bean is injected for the first time or restored when a new instance of * this Bean needs to be instantiated. * * <p>The model of the Bean will be instantiated by model's default no-argument constructor. * However, if the Bean needs to be restored, a new instance of model restored by * {@link #restoreModel(Object)} will replace the model created by this method.</p> */ public void onCreated() { model = instantiateModel(); }
private void onEvent(CounterManager.Event2C.OnCounterUpdated event) { if (view != null) { view.update(); } }
/** * Initiates a {@link Navigator} to start navigation. * @param sender Who wants to navigate * @return A new instance of {@link Navigator} */ public Navigator navigate(Object sender) { return new Navigator(sender, this); }