Object ApplicationStates
-
- All Implemented Interfaces:
public class ApplicationStates
Represents 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 Boolean
settingsParametersReady
private final Boolean
httpClientReady
private final Boolean
authenticated
private final static Boolean
onFront
private final Boolean
isNetworkAvailable
private final Boolean
applicationLocked
public final static ApplicationStates
INSTANCE
-
Method Summary
Modifier and Type Method Description final Unit
addStateObserver(Observer o)
final ApplicationStates
addStateListener(Function1<ApplicationState, Unit> listener)
Adds a state listener final Boolean
removeStateListener(Function1<ApplicationState, Unit> listener)
Removes the given listener final Boolean
getSettingsParametersReady()
final Boolean
getHttpClientReady()
final Boolean
getAuthenticated()
final static Boolean
getOnFront()
final Boolean
isNetworkAvailable()
final Boolean
getApplicationLocked()
The state of the locked or not of the application. -
-
Method Detail
-
addStateObserver
@Deprecated(message = "Deprecated in SDK 7.0", replaceWith = @ReplaceWith(imports = {}, expression = "addStateListener")) final Unit addStateObserver(Observer o)
-
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 static 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
-
-
-
-