public class DoghouseReceiver extends android.content.BroadcastReceiver implements MapItem.OnVisibleChangedListener, android.content.SharedPreferences.OnSharedPreferenceChangeListener, MapEventDispatcher.MapEventDispatchListener, Shape.OnPointsChangedListener, Route.OnRouteMethodChangedListener, Shape.OnStrokeColorChangedListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHANGE_DTD_ID
Intent to change the DTD ID of the each doghouse for a Route
|
static java.lang.String |
DISTANCE_FROM_LEG
Set the distance from the associated route
|
static int |
DISTANCE_FROM_LEG_MAX
Maximum distance from the associated route
|
static java.lang.String |
DOGHOUSE_GROUP
Name of the Doghouse MapGroup
|
static java.lang.String |
MAX_SCALE_VISIBLE |
static java.lang.String |
META_CASCADE_DTD_ID |
static java.lang.String |
META_DTD_ID |
static java.lang.String |
META_SHOW_DOGHOUSES
Key for route metadata boolean indicating whether to show/hide doghouses
|
static java.lang.String |
NORTH_REFERENCE_KEY |
static java.lang.String |
PERCENT_ALONG_LEG
Set the distance along the associated route as a percentage
|
static float |
PERCENT_ALONG_LEG_MAX
Maximum percentage along the associated route (100, duh)
|
static java.lang.String |
RELATIVE_LOCATION
Set the location preference relative to the associated route
|
static java.lang.String |
SHADE_COLOR |
static java.lang.String |
SHOW_NORTH_REF |
static java.lang.String |
SIZE_SEGMENT
The length of one segment of doghouse as drawn by the graphics lib
|
static java.lang.String |
STROKE_COLOR |
static java.lang.String |
STROKE_WIDTH |
static java.lang.String |
TEXT_COLOR |
Modifier and Type | Method and Description |
---|---|
void |
addDoghousesForRoute(Route route)
Add doghouses for a Route.
|
void |
addDoghousesForRoute(java.lang.String uid)
Add doghouses for a route given its UID
|
void |
dispose() |
Doghouse |
getDoghouseForRoute(int index,
Route route)
Get the doghouse for a route at the specified point within the route
|
java.util.List<Doghouse> |
getDoghousesForRoute(Route route)
Get doghouses for this route if there are any.
|
DoghouseViewModel |
getDoghouseViewModel() |
static DoghouseReceiver |
getInstance() |
static DoghouseReceiver |
newInstance(MapView mapView) |
void |
onMapEvent(MapEvent event) |
void |
onPointsChanged(Shape s) |
void |
onReceive(android.content.Context context,
android.content.Intent intent) |
void |
onRouteMethodChanged(Route route)
If a route's method changes, respond by either adding or removing
doghouses for that route depending on it's new type.
|
void |
onSharedPreferenceChanged(android.content.SharedPreferences prefs,
java.lang.String key) |
void |
onStrokeColorChanged(Shape s)
Change visibility of the doghouse when routes get faded out
e.g.
|
void |
onVisibleChanged(MapItem item)
When a route's visibility changes, change the doghouse visibility to match.
|
void |
removeDoghousesForRoute(Route route)
Remove doghouses for a particular Route.
|
void |
removeDoghousesForRoute(java.lang.String uid)
Remove doghouses for a route given its UID.
|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
public static final java.lang.String DOGHOUSE_GROUP
public static final java.lang.String META_SHOW_DOGHOUSES
public static final java.lang.String CHANGE_DTD_ID
public static final java.lang.String META_DTD_ID
public static final java.lang.String META_CASCADE_DTD_ID
public static final java.lang.String DISTANCE_FROM_LEG
public static final java.lang.String PERCENT_ALONG_LEG
public static final java.lang.String RELATIVE_LOCATION
public static final java.lang.String NORTH_REFERENCE_KEY
public static final int DISTANCE_FROM_LEG_MAX
public static final float PERCENT_ALONG_LEG_MAX
public static final java.lang.String STROKE_WIDTH
public static final java.lang.String STROKE_COLOR
public static final java.lang.String TEXT_COLOR
public static final java.lang.String SHADE_COLOR
public static final java.lang.String MAX_SCALE_VISIBLE
public static final java.lang.String SIZE_SEGMENT
public static final java.lang.String SHOW_NORTH_REF
public void dispose()
public void onReceive(android.content.Context context, android.content.Intent intent)
onReceive
in class android.content.BroadcastReceiver
public void onSharedPreferenceChanged(android.content.SharedPreferences prefs, java.lang.String key)
onSharedPreferenceChanged
in interface android.content.SharedPreferences.OnSharedPreferenceChangeListener
public static DoghouseReceiver newInstance(MapView mapView)
public static DoghouseReceiver getInstance()
public void onMapEvent(MapEvent event)
onMapEvent
in interface MapEventDispatcher.MapEventDispatchListener
public void onVisibleChanged(MapItem item)
onVisibleChanged
in interface MapItem.OnVisibleChangedListener
item
- The map item whose visibility changedpublic void onStrokeColorChanged(Shape s)
onStrokeColorChanged
in interface Shape.OnStrokeColorChangedListener
s
- the shapepublic void onPointsChanged(Shape s)
onPointsChanged
in interface Shape.OnPointsChangedListener
public void onRouteMethodChanged(Route route)
onRouteMethodChanged
in interface Route.OnRouteMethodChangedListener
route
- The route whose method was changedpublic DoghouseViewModel getDoghouseViewModel()
public void addDoghousesForRoute(java.lang.String uid)
uid
- The UID of the routeaddDoghousesForRoute(Route)
public void addDoghousesForRoute(Route route)
route
- The routepublic Doghouse getDoghouseForRoute(int index, Route route)
index
- The index of the route pointroute
- The routenull
public java.util.List<Doghouse> getDoghousesForRoute(Route route)
route
- The routenull
public void removeDoghousesForRoute(java.lang.String uid)
uid
- The UID of the route.removeDoghousesForRoute(Route)
public void removeDoghousesForRoute(Route route)
route
- The Route