public class

MapstedAlertsApi

extends Object
implements AlertsApi MapUiApi.AlertProvider
java.lang.Object
   ↳ com.mapsted.alerts.MapstedAlertsApi

Class Overview

MapstedAlertsApi class is used to get alerts for a property. It also provides callbacks for alerts which should be activated based on user position transition in the property. Use Mapsted Hub dashboard to setup the alerts for your property.

Summary

Nested Classes
class MapstedAlertsApi.EventsImpl  
class MapstedAlertsApi.ViewsImpl  
Public Methods
boolean addActiveAlertChangeListener(MapUiApi.AlertChangeListener listener)
boolean addAlertsOnChangeListener(AlertsOnChangeListener listener)
Register onChangeListener for property user is interested in but not necessarily at the property.
boolean addScheduledAlertTriggerListener(AlertsApi.ScheduledAlertTriggerListener listener)
Set callback for when scheduled alerts triggers while the user is at a property.
void createAlertListPartialFragment(List<String> alertIds, Consumer<Fragment> fragmentConsumer)
Create partial fragment alert list for given alertIds
boolean displayAlertListDialog(List<String> alertIds, FragmentManager fragmentManager, Consumer<EntityZone> entityZoneSelection)
AlertsApi.Events events()
void getActiveAlerts(int propertyId, Consumer<List<String>> consumer)
Get the list of active alerts by propertyId
Fragment getEntityAlertListFragment(Entity entity)
boolean hasAlerts(Entity selectedEntity)
AlertsApi.Lifecycle lifecycle()
static AlertsApi newInstance(Context context, CoreApi coreApi)
Create a new AlertsApi instance
static AlertsApi newInstance(Context context, MapUiApi mapUiApi)
Create a new AlertsApi instance
boolean removeActiveAlertChangeListener(MapUiApi.AlertChangeListener listener)
boolean removeAlertsOnChangeListener(AlertsOnChangeListener listener)
Unregister a previously registered callback.
boolean removeScheduledAlertTriggerListener(AlertsApi.ScheduledAlertTriggerListener listener)
Remove callback for when scheduled alerts triggers while the user is at a property.
AlertsApi.Repo repo()
AlertsApi.Setup setup()
void showAlertDialogForEntity(Entity entity, FragmentManager fragmentManager, Consumer<EntityZone> entityZoneSelection)
AlertsApi.Views views()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.mapsted.alerts.AlertsApi
From interface com.mapsted.ui.MapUiApi.AlertProvider

Public Methods

public boolean addActiveAlertChangeListener (MapUiApi.AlertChangeListener listener)

public boolean addAlertsOnChangeListener (AlertsOnChangeListener listener)

Register onChangeListener for property user is interested in but not necessarily at the property.

public boolean addScheduledAlertTriggerListener (AlertsApi.ScheduledAlertTriggerListener listener)

Set callback for when scheduled alerts triggers while the user is at a property.

Parameters
listener callback with the ScheduledAlert that got triggered.

public void createAlertListPartialFragment (List<String> alertIds, Consumer<Fragment> fragmentConsumer)

Create partial fragment alert list for given alertIds

Parameters
alertIds the alerts to populate
fragmentConsumer the created fragment (nullable)

public boolean displayAlertListDialog (List<String> alertIds, FragmentManager fragmentManager, Consumer<EntityZone> entityZoneSelection)

public AlertsApi.Events events ()

public void getActiveAlerts (int propertyId, Consumer<List<String>> consumer)

Get the list of active alerts by propertyId

Parameters
propertyId the property of interest

public Fragment getEntityAlertListFragment (Entity entity)

public boolean hasAlerts (Entity selectedEntity)

public AlertsApi.Lifecycle lifecycle ()

public static AlertsApi newInstance (Context context, CoreApi coreApi)

Create a new AlertsApi instance

Parameters
context application context
coreApi an initialized coreApi
Returns
  • AlertsApi

public static AlertsApi newInstance (Context context, MapUiApi mapUiApi)

Create a new AlertsApi instance

Parameters
context application context
mapUiApi an initialized mapUiApi
Returns
  • AlertsApi

public boolean removeActiveAlertChangeListener (MapUiApi.AlertChangeListener listener)

public boolean removeAlertsOnChangeListener (AlertsOnChangeListener listener)

Unregister a previously registered callback.

public boolean removeScheduledAlertTriggerListener (AlertsApi.ScheduledAlertTriggerListener listener)

Remove callback for when scheduled alerts triggers while the user is at a property.

Parameters
listener callback with the ScheduledAlert that got triggered.

public AlertsApi.Repo repo ()

public AlertsApi.Setup setup ()

public void showAlertDialogForEntity (Entity entity, FragmentManager fragmentManager, Consumer<EntityZone> entityZoneSelection)

public AlertsApi.Views views ()