Search in sources :

Example 16 with ObjectRegistry

use of com.cjsoftware.library.core.ObjectRegistry in project ucsFramework by cjsoftware-lib.

the class AbstractUiDialogFragment method onSaveInstanceState.

// endregion
// region Android lifecycle
@CallSuper
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    ObjectRegistry objectRegistry = getObjectRegistry();
    outState.putString(STATE_CONTRACT_BROKER, objectRegistry.put(mContractBroker));
}
Also used : ObjectRegistry(com.cjsoftware.library.core.ObjectRegistry) CallSuper(android.support.annotation.CallSuper)

Example 17 with ObjectRegistry

use of com.cjsoftware.library.core.ObjectRegistry in project ucsFramework by cjsoftware-lib.

the class AbstractUiFragment method restoreContractBroker.

// endregion
// region private helper methods
private ContractBroker<UiT, NavigationT, CoordinatorT, StateManagerT> restoreContractBroker(Bundle savedState) {
    ContractBroker<UiT, NavigationT, CoordinatorT, StateManagerT> coordinator = null;
    ObjectRegistry objectRegistry = getObjectRegistry();
    String coordinatorKey = savedState.getString(STATE_CONTRACT_BROKER);
    if (coordinatorKey != null) {
        coordinator = objectRegistry.get(coordinatorKey);
    }
    return coordinator;
}
Also used : ObjectRegistry(com.cjsoftware.library.core.ObjectRegistry)

Example 18 with ObjectRegistry

use of com.cjsoftware.library.core.ObjectRegistry in project ucsFramework by cjsoftware-lib.

the class AbstractSmvpActivity method onSaveInstanceState.

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    // Save the Presenter & Model stack.
    ObjectRegistry objectRegistry = getObjectRegistry();
    String presenterStackKey = objectRegistry.put(getPresenter());
    outState.putString(SAVED_PRESENTER_STACK_KEY, presenterStackKey);
}
Also used : ObjectRegistry(com.cjsoftware.library.core.ObjectRegistry)

Aggregations

ObjectRegistry (com.cjsoftware.library.core.ObjectRegistry)18 CallSuper (android.support.annotation.CallSuper)6 NonNull (android.support.annotation.NonNull)3 StatePreservationManager (com.cjsoftware.library.uistatepreservation.StatePreservationManager)3