public abstract class PluginTrigger
extends java.lang.Object
| Constructor and Description |
|---|
PluginTrigger() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.util.List<RequiredApp> |
getRequiredApps()
This method should return a list of apps required to execute the trigger.
|
abstract java.lang.String |
getTriggerDescription(android.content.Context context)
Gets the default trigger description.
|
abstract java.lang.String |
getTriggerDescription(android.content.Context context,
PluginDataFieldCollection data)
Gets the trigger description when parameters are set.
|
java.lang.String |
getTriggerDescription(android.content.Context context,
java.lang.String data)
Do not use - for internal use only
|
abstract PluginDataFieldCollection |
getTriggerFields(android.content.Context context)
Gets the trigger parameters fields collection.
|
abstract int |
getTriggerIconResourceId()
Gets the trigger icon resource id.
|
protected long |
getTriggerId() |
abstract int |
getTriggerSmallIconResourceId()
Gets the trigger small icon resource id.
|
abstract java.lang.String |
getTriggerTitle(android.content.Context context)
Gets the trigger title.
|
void |
launchTrigger()
Call this method when the trigger event is set.
When this method is called, it notifies AutomateIt that the trigger is set and it should launch its related action. |
void |
performInitialSetup(android.content.Context context)
This method is called when
requiresInitialSetup returns true. |
boolean |
requiresInitialSetup(android.content.Context context)
Override this method to indicate the plugin trigger requires initial setup before it can be used by AutomateIt.
|
void |
startListening(android.content.Context context,
long triggerId)
Do not use - for internal use only
|
void |
startListening(android.content.Context context,
long triggerId,
PluginDataFieldCollection data)
Do not use - for internal use only
|
abstract void |
startListening(android.content.Context context,
PluginDataFieldCollection data)
This method is called when the trigger should start waiting for execution.
|
abstract void |
stopListening(android.content.Context context)
This method is called when the trigger should stop waiting for execution.
|
abstract PluginValidationResult |
validateData(android.content.Context context,
PluginDataFieldCollection data)
Validate the trigger data.
|
PluginValidationResult |
validateData(android.content.Context context,
java.lang.String data)
Do not use - for internal use only
|
public abstract java.lang.String getTriggerTitle(android.content.Context context)
context - The context through which you can access the plugin resources through which you can access the plugin resourcespublic abstract java.lang.String getTriggerDescription(android.content.Context context)
context - The context through which you can access the plugin resourcespublic abstract java.lang.String getTriggerDescription(android.content.Context context,
PluginDataFieldCollection data)
context - The context through which you can access the plugin resourcesdata - The trigger parameterspublic abstract int getTriggerIconResourceId()
public abstract int getTriggerSmallIconResourceId()
public abstract PluginDataFieldCollection getTriggerFields(android.content.Context context)
context - The context through which you can access the plugin resourcespublic abstract PluginValidationResult validateData(android.content.Context context, PluginDataFieldCollection data)
startListeningcontext - The context through which you can access the plugin resourcesdata - The trigger parameters with values set by the user (If getTriggerFields is not null)getValidResultpublic abstract java.util.List<RequiredApp> getRequiredApps()
RequiredApp object to the return value.
When the plugin main activity is shown, it will add an "Install" button for each required app, redirecting the user to the Play Store for downloading the app.public abstract void startListening(android.content.Context context,
PluginDataFieldCollection data)
context - The context through which you can access the plugin resourcesdata - The trigger parameters with values set by the user (If getTriggerFields is not null)public abstract void stopListening(android.content.Context context)
context - The context through which you can access the plugin resourcespublic boolean requiresInitialSetup(android.content.Context context)
context - The context through which you can access the plugin resourcespublic void performInitialSetup(android.content.Context context)
requiresInitialSetup returns true.
Any initial setup logic should be implemented in this method.context - The context through which you can access the plugin resourcespublic final void launchTrigger()
public final void startListening(android.content.Context context,
long triggerId,
PluginDataFieldCollection data)
public final void startListening(android.content.Context context,
long triggerId)
public final java.lang.String getTriggerDescription(android.content.Context context,
java.lang.String data)
public final PluginValidationResult validateData(android.content.Context context, java.lang.String data)
protected long getTriggerId()