Object ApplicationStates
-
- All Implemented Interfaces:
public class ApplicationStatesRepresents the state holder of the application. When the application state changes, the state change producer will notify this holder, then the state will be saved inside this, and notify the observers which are interested in the state changes. For example, if one service wants to do something when the application is brought to background, it can observe the ApplicationState.OnFrontChange, and if the operation also depends on other state, for example, http client must be ready, it can query this state holder for that state.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleansettingsParametersReadyprivate final BooleanhttpClientReadyprivate final Booleanauthenticatedprivate final BooleanonFrontprivate final BooleanisNetworkAvailableprivate final BooleanapplicationLockedpublic final static ApplicationStatesINSTANCE
-
Method Summary
Modifier and Type Method Description final ApplicationStatesaddStateListener(Function1<ApplicationState, Unit> listener)Adds a state listener final BooleanremoveStateListener(Function1<ApplicationState, Unit> listener)Removes the given listener final BooleangetSettingsParametersReady()final BooleangetHttpClientReady()final BooleangetAuthenticated()final BooleangetOnFront()final BooleanisNetworkAvailable()final BooleangetApplicationLocked()The state of the locked or not of the application. -
-
Method Detail
-
addStateListener
final ApplicationStates addStateListener(Function1<ApplicationState, Unit> listener)
Adds a state listener
-
removeStateListener
final Boolean removeStateListener(Function1<ApplicationState, Unit> listener)
Removes the given listener
-
getSettingsParametersReady
final Boolean getSettingsParametersReady()
-
getHttpClientReady
final Boolean getHttpClientReady()
-
getAuthenticated
final Boolean getAuthenticated()
-
getOnFront
final Boolean getOnFront()
-
isNetworkAvailable
final Boolean isNetworkAvailable()
-
getApplicationLocked
final Boolean getApplicationLocked()
The state of the locked or not of the application. TimeoutLockService will update the state
-
-
-
-