public class SelfCoordOverlayUpdater extends CotStreamListener implements MapEventDispatcher.MapEventDispatchListener, android.content.SharedPreferences.OnSharedPreferenceChangeListener, PointMapItem.OnPointChangedListener, MapWidget.OnClickListener, android.view.View.OnClickListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
SelfCoordOverlayUpdater.ConnectedButtonWidgetCallback |
protected class |
SelfCoordOverlayUpdater.Updater |
CotStreamListener.CotStreamUpdateWraper| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_bAtLeastOneConnection
We display if at least one TAK Server connection exists on local device
|
protected boolean |
_bConnected
Track if we're currently connected
|
protected MarkerIconWidget |
_connectedButtonWidget
Display status of TAK server connection
|
protected int |
_connIcon |
protected CoordinateFormat |
_coordMode |
static SelfCoordOverlayUpdater |
_instance |
protected static java.text.DecimalFormat |
_noDecimalFormat |
protected TextWidget |
_noGpsMessage |
protected int |
_northReference |
protected android.content.SharedPreferences |
_prefs |
protected boolean |
_streamChanged |
protected TextWidget |
_text |
protected MapWidget.OnLongPressListener |
_textLongPressListener |
protected SelfCoordOverlayUpdater.Updater |
calc |
static java.lang.String |
DISPLAY_BOTTOM_BAR |
static java.lang.String |
DISPLAY_BOTTOM_RIGHT |
static java.lang.String |
DISPLAY_NONE |
protected static int |
NOTIFICATION_ID |
static java.lang.String |
PREF_DISPLAY |
protected SpeedFormatter |
speedFormatter |
_context, _name, _streams| Constructor and Description |
|---|
SelfCoordOverlayUpdater(MapView mapView) |
| Modifier and Type | Method and Description |
|---|---|
void |
change() |
protected void |
connected(CotPortListActivity.CotPort port,
boolean connected)
Invoked when connection to a TAK Server is established or disconnected
|
void |
dispose() |
protected void |
enabled(CotPortListActivity.CotPort port,
boolean enabled)
Invoked when connection to a TAK Server is enabled or disabled by user
|
protected NotificationUtil.NotificationColor |
getConnectedColor() |
protected int |
getConnectedDrawable() |
java.lang.String |
getDisplayType()
Get the self coordinate info display position/type
|
static SelfCoordOverlayUpdater |
getInstance() |
TextWidget |
getWidget()
Get the GPS text widget
|
void |
onClick(android.view.View v) |
void |
onCotOutputRemoved(android.os.Bundle bundle)
Note, currently called by CotService when removed or disconnected
CotServiceRemote.OutputsChangedListener.onCotOutputRemoved
|
void |
onMapEvent(MapEvent event) |
void |
onMapWidgetClick(MapWidget widget,
android.view.MotionEvent event) |
void |
onPointChanged(PointMapItem item) |
void |
onSharedPreferenceChanged(android.content.SharedPreferences sp,
java.lang.String key) |
protected void |
serviceConnected()
Invoked when connection to device's CoT service occurs
|
static void |
setConnectedButtonWidgetCallback(SelfCoordOverlayUpdater.ConnectedButtonWidgetCallback callback)
Sets a callback that will fire when the connectedButtonWidget is clicked.
|
boolean |
showGPSWidget(boolean show) |
protected void |
updateTextVisibility() |
addStreams, containsUrl, findExistingStream, getConnectedServerString, getConnectedServerUrl, getFirstActiveDescription, getPrimaryConnection, getRemote, getServers, getStreamCount, init, isConnected, isConnected, isEnabled, onCotOutputUpdated, onCotServiceConnected, onCotServiceDisconnected, removeStream, serviceDisconnectedpublic static final java.lang.String PREF_DISPLAY
public static final java.lang.String DISPLAY_BOTTOM_RIGHT
public static final java.lang.String DISPLAY_BOTTOM_BAR
public static final java.lang.String DISPLAY_NONE
protected static final java.text.DecimalFormat _noDecimalFormat
protected TextWidget _text
protected TextWidget _noGpsMessage
protected SelfCoordOverlayUpdater.Updater calc
protected static final int NOTIFICATION_ID
protected final MarkerIconWidget _connectedButtonWidget
protected int _connIcon
protected CoordinateFormat _coordMode
protected final android.content.SharedPreferences _prefs
protected int _northReference
protected boolean _bConnected
protected boolean _bAtLeastOneConnection
protected boolean _streamChanged
protected SpeedFormatter speedFormatter
public static SelfCoordOverlayUpdater _instance
protected final MapWidget.OnLongPressListener _textLongPressListener
public SelfCoordOverlayUpdater(MapView mapView)
public void onMapEvent(MapEvent event)
onMapEvent in interface MapEventDispatcher.MapEventDispatchListenerpublic static SelfCoordOverlayUpdater getInstance()
public void change()
public void dispose()
dispose in class CotStreamListenerpublic void onSharedPreferenceChanged(android.content.SharedPreferences sp,
java.lang.String key)
onSharedPreferenceChanged in interface android.content.SharedPreferences.OnSharedPreferenceChangeListenerpublic void onPointChanged(PointMapItem item)
onPointChanged in interface PointMapItem.OnPointChangedListenerpublic TextWidget getWidget()
public java.lang.String getDisplayType()
DISPLAY_BOTTOM_RIGHT, DISPLAY_BOTTOM_BAR
or DISPLAY_NONEpublic void onMapWidgetClick(MapWidget widget, android.view.MotionEvent event)
onMapWidgetClick in interface MapWidget.OnClickListenerpublic void onClick(android.view.View v)
onClick in interface android.view.View.OnClickListenerpublic boolean showGPSWidget(boolean show)
protected void updateTextVisibility()
protected int getConnectedDrawable()
protected NotificationUtil.NotificationColor getConnectedColor()
protected void serviceConnected()
CotStreamListenerserviceConnected in class CotStreamListenerpublic void onCotOutputRemoved(android.os.Bundle bundle)
CotStreamListeneronCotOutputRemoved in interface CotServiceRemote.OutputsChangedListeneronCotOutputRemoved in class CotStreamListenerbundle - the bundle that describes the stream.protected void enabled(CotPortListActivity.CotPort port, boolean enabled)
CotStreamListenerenabled in class CotStreamListenerport - the connection to enable or disable.protected void connected(CotPortListActivity.CotPort port, boolean connected)
CotStreamListenerconnected in class CotStreamListenerport - the cot port that is connected or disconnected as specified by the connected parameterconnected - true or false depending on the statuspublic static void setConnectedButtonWidgetCallback(SelfCoordOverlayUpdater.ConnectedButtonWidgetCallback callback)
callback - the callback to use