public abstract class AbstractFeatureManager extends AbstractManager implements FeatureManager, android.app.Application.ActivityLifecycleCallbacks
AbstractFeatureManager provides a default implementation of FeatureManager.| Constructor and Description |
|---|
AbstractFeatureManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
conditionallyRestartFeature(Feature feature,
FeatureView featureView)
Check the execution state of the given
Feature and if not started then start
the Feature for the given FeatureView. |
Feature |
createFeature(java.lang.Class<? extends Feature> featureClass)
Creates the specified
Feature, but does not start it. |
java.util.List<Feature> |
getActiveChildFeatures(Feature parentFeature)
|
java.util.List<Feature> |
getActiveFeatures()
Gets the currently active
Features. |
android.app.Application.ActivityLifecycleCallbacks |
getActivityLifecycleCallback()
Gets an object that implements
Application.ActivityLifecycleCallbacks. |
FeatureContainer |
getFeatureContainer(int featureContainerId)
Gets a
FeatureContainer with the given ID. |
android.app.Activity |
getForegroundActivity()
Gets the
Activity that is currently in foreground. |
java.util.List<Feature> |
getForegroundFeatures()
|
static FeatureManager |
getInstance() |
android.app.Activity |
getLastPausedActivity()
Gets the
Activity that is the last paused Activity. |
android.app.Activity |
getLastStoppedActivity()
Gets the
Activity that is the last stopped Activity. |
java.util.List<Feature> |
getPausedFeatures()
Gets the currently paused
Features. |
boolean |
hasActiveChildFeatures(Feature parentFeature)
|
void |
onActivityCreated(android.app.Activity activity,
android.os.Bundle inState) |
void |
onActivityDestroyed(android.app.Activity activity) |
void |
onActivityPaused(android.app.Activity activity) |
void |
onActivityResumed(android.app.Activity activity) |
void |
onActivitySaveInstanceState(android.app.Activity activity,
android.os.Bundle outState) |
void |
onActivityStarted(android.app.Activity activity) |
void |
onActivityStopped(android.app.Activity activity) |
boolean |
onBackPressed()
Invoked to handle Back Pressed event received by the
FeatureContainer. |
void |
onFeatureDestroyed(Feature feature)
Invoked by a
PluginStateComponent.destroy() when the Feature} has been destroyed. |
void |
onFeaturePaused(Feature feature,
boolean finishing)
Invoked by a
PluginStateComponent.pause() when the Feature} has been paused. |
void |
onFeatureResumed(Feature feature)
Invoked by a
PluginStateComponent.resume() when the Feature} has been resumed. |
void |
onFeatureStopped(Feature feature)
Invoked by a
PluginStateComponent.stop() when the Feature} has been stopped. |
void |
registerFeatureContainerProvider(FeatureContainerProvider provider)
Register the given
FeatureContainerProvider for this FeatureManager so
that Features can access their FeatureContainers. |
static void |
setInstance(FeatureManager instance) |
void |
setMockScopeOwner(DependencyScopeOwner owner)
Sets a
DependencyScopeOwner that is used to provide a DependencyScope
containing mock dependencies for testing purposes. |
Feature |
startFeature(FeatureContainer featureContainer,
java.lang.Class<? extends Feature> featureClass)
Creates and starts the specified
Feature whose FeatureCompatFragments are hosted by
the given FeatureContainer. |
Feature |
startFeature(FeatureContainer featureContainer,
java.lang.Class<? extends Feature> featureClass,
Params params)
Creates and starts the specified
Feature whose FeatureCompatFragments are
shown using the given FeatureContainer. |
Feature |
startFeature(FeatureContainer featureContainer,
Feature feature)
|
Feature |
startFeature(FeatureContainer featureContainer,
Feature feature,
Params params)
|
Feature |
startFeature(int featureContainerId,
java.lang.Class<? extends Feature> featureClass,
Params params)
Creates and starts the specified
Feature whose FeatureCompatFragments are
shown using the specified FeatureContainer. |
Feature |
startFeature(int featureContainerId,
Feature feature,
Params params)
|
void |
unregisterFeatureContainerProvider(FeatureContainerProvider provider)
Unregister the given
FeatureContainerProvider from this FeatureManager. |
onPlugged, onPluginPlugged, onPluginUnplugged, onUnpluggedgetScope, setScopeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonPlugged, onPluginPlugged, onPluginUnplugged, onUnpluggedpublic static FeatureManager getInstance()
public static void setInstance(FeatureManager instance)
public java.util.List<Feature> getActiveChildFeatures(Feature parentFeature)
FeatureManagergetActiveChildFeatures in interface FeatureManagerparentFeature - A parent Feature.List of child features. May not be null.public boolean hasActiveChildFeatures(Feature parentFeature)
FeatureManagerhasActiveChildFeatures in interface FeatureManagerparentFeature - A parent Feature.booleanpublic android.app.Application.ActivityLifecycleCallbacks getActivityLifecycleCallback()
FeatureManagerApplication.ActivityLifecycleCallbacks.getActivityLifecycleCallback in interface FeatureManagerApplication.ActivityLifecycleCallbacks.public android.app.Activity getForegroundActivity()
FeatureManagerActivity that is currently in foreground.getForegroundActivity in interface FeatureManagerActivity. May return null.public android.app.Activity getLastPausedActivity()
FeatureManagerActivity that is the last paused Activity.getLastPausedActivity in interface FeatureManagerActivity. May return null.public android.app.Activity getLastStoppedActivity()
FeatureManagerActivity that is the last stopped Activity.getLastStoppedActivity in interface FeatureManagerActivity. May return null.public void setMockScopeOwner(DependencyScopeOwner owner)
FeatureManagerDependencyScopeOwner that is used to provide a DependencyScope
containing mock dependencies for testing purposes.setMockScopeOwner in interface FeatureManagerowner - A DependencyScopeOwner.public java.util.List<Feature> getActiveFeatures()
FeatureManagerFeatures.getActiveFeatures in interface FeatureManagerList of Features.public java.util.List<Feature> getPausedFeatures()
FeatureManagerFeatures.getPausedFeatures in interface FeatureManagerList of Features.public java.util.List<Feature> getForegroundFeatures()
FeatureManagergetForegroundFeatures in interface FeatureManagerList of Features.public FeatureContainer getFeatureContainer(int featureContainerId)
FeatureManagerFeatureContainer with the given ID.getFeatureContainer in interface FeatureManagerfeatureContainerId - The ID of the FeatureContainer.FeatureContainer.public Feature createFeature(java.lang.Class<? extends Feature> featureClass)
FeatureManagerFeature, but does not start it. If the feature is
a DependencyScopeOwner its DependencyScope is added to cache of
DependencyScopes.createFeature in interface FeatureManagerfeatureClass - A FeatureFeature.public Feature startFeature(FeatureContainer featureContainer, java.lang.Class<? extends Feature> featureClass)
FeatureManagerFeature whose FeatureCompatFragments are hosted by
the given FeatureContainer.startFeature in interface FeatureManagerfeatureContainer - A FeatureContainer.featureClass - A Class specifying the Feature to be created and started.Feature.public Feature startFeature(int featureContainerId, java.lang.Class<? extends Feature> featureClass, Params params)
FeatureManagerFeature whose FeatureCompatFragments are
shown using the specified FeatureContainer.startFeature in interface FeatureManagerfeatureContainerId - An ID of the FeatureContainer. In practice the ID is
the layout view ID of the ViewGroup that contains the View.featureClass - A Class specifying the Feature to be created and started.params - A Params containing parameters for the created and started Feature.Feature.public Feature startFeature(FeatureContainer featureContainer, java.lang.Class<? extends Feature> featureClass, Params params)
FeatureManagerFeature whose FeatureCompatFragments are
shown using the given FeatureContainer.startFeature in interface FeatureManagerfeatureContainer - A FeatureContainer.featureClass - A Class specifying the Feature to be created and started.params - A Params containing parameters for the created and started Feature.Feature.public Feature startFeature(FeatureContainer featureContainer, Feature feature)
FeatureManagerstartFeature in interface FeatureManagerfeatureContainer - A FeatureContainer.feature - {The Feature to be started.Feature.public Feature startFeature(FeatureContainer featureContainer, Feature feature, Params params)
FeatureManagerstartFeature in interface FeatureManagerfeatureContainer - A FeatureContainer.feature - {The Feature to be started.params - A Params containing parameters for the started Feature.Feature.public Feature startFeature(int featureContainerId, Feature feature, Params params)
FeatureManagerstartFeature in interface FeatureManagerfeatureContainerId - An ID of the FeatureContainer. In practice the ID is
the layout view ID of the ViewGroup that contains the View.feature - {The Feature to be started.params - A Params containing parameters for the started Feature.Feature.public boolean conditionallyRestartFeature(Feature feature, FeatureView featureView)
FeatureManagerFeature and if not started then start
the Feature for the given FeatureView.conditionallyRestartFeature in interface FeatureManagerfeature - A Feature.featureView - A FeatureView.boolean value if the Feature was restarted.public void registerFeatureContainerProvider(FeatureContainerProvider provider)
FeatureManagerFeatureContainerProvider for this FeatureManager so
that Features can access their FeatureContainers.registerFeatureContainerProvider in interface FeatureManagerprovider - A FeatureContainerProvider.public void unregisterFeatureContainerProvider(FeatureContainerProvider provider)
FeatureManagerFeatureContainerProvider from this FeatureManager.unregisterFeatureContainerProvider in interface FeatureManagerprovider - A FeatureContainerProvider.public boolean onBackPressed()
FeatureContainer.onBackPressed in interface FeatureManagerboolean value indicating if the event was consumed by this method.public void onFeatureResumed(Feature feature)
FeatureManagerPluginStateComponent.resume() when the Feature} has been resumed.onFeatureResumed in interface FeatureManagerfeature - A Feature. May not be null.public void onFeaturePaused(Feature feature, boolean finishing)
FeatureManagerPluginStateComponent.pause() when the Feature} has been paused.onFeaturePaused in interface FeatureManagerfeature - A Feature. May not be null.finishing - A boolean value indicating if the PluginStateComponent is
going to be finished i.e. it is not resumed nor restarted anymore.public void onFeatureStopped(Feature feature)
FeatureManagerPluginStateComponent.stop() when the Feature} has been stopped.onFeatureStopped in interface FeatureManagerfeature - A Feature. May not be null.public void onFeatureDestroyed(Feature feature)
FeatureManagerPluginStateComponent.destroy() when the Feature} has been destroyed.onFeatureDestroyed in interface FeatureManagerfeature - A Feature. May not be null.public void onActivityCreated(android.app.Activity activity,
android.os.Bundle inState)
onActivityCreated in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivityStarted(android.app.Activity activity)
onActivityStarted in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivityResumed(android.app.Activity activity)
onActivityResumed in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivityPaused(android.app.Activity activity)
onActivityPaused in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivityStopped(android.app.Activity activity)
onActivityStopped in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivitySaveInstanceState(android.app.Activity activity,
android.os.Bundle outState)
onActivitySaveInstanceState in interface android.app.Application.ActivityLifecycleCallbackspublic void onActivityDestroyed(android.app.Activity activity)
onActivityDestroyed in interface android.app.Application.ActivityLifecycleCallbacks