public class IndividualContact extends Contact implements MapItemUser
Contact.UpdateStatus
HierarchyListItem.ComparatorSort, HierarchyListItem.Sort, HierarchyListItem.SortAlphabet, HierarchyListItem.SortAlphabetDesc, HierarchyListItem.SortDistanceFrom
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,Connector> |
connectors |
static java.lang.String |
DEFAULT_CONNECTOR |
BACKGROUND_COLOR_ALIVE, BACKGROUND_COLOR_DEAD, BACKGROUND_COLOR_NA, BACKGROUND_COLOR_STALE, contactUUID, FOREGROUND_COLOR_ALIVE, FOREGROUND_COLOR_DEAD, FOREGROUND_COLOR_STALE
asyncRefresh, children, disposed, filter, listener, postFilter, reusable, uiHandler
Constructor and Description |
---|
IndividualContact(java.lang.String name) |
IndividualContact(java.lang.String name,
java.lang.String uuid) |
IndividualContact(java.lang.String name,
java.lang.String uuid,
MapItem assocItem) |
IndividualContact(java.lang.String name,
java.lang.String uuid,
MapItem assocItem,
NetConnectString ncs)
ctor
|
IndividualContact(java.lang.String name,
java.lang.String uuid,
NetConnectString ncs) |
Modifier and Type | Method and Description |
---|---|
boolean |
addConnector(Connector connector)
Add or update connector of the specified type
|
void |
current()
Set status to CURRENT
|
void |
die()
Set status to DEAD
|
java.util.List<java.lang.String[]> |
findChildPaths(java.lang.String uid)
Find the path to the child contact UID to this contact
|
int |
getBackgroundColor()
Get the color of the contact view background
|
Connector |
getConnector(java.lang.String type)
Get connector of the specified type
|
java.util.Collection<Connector> |
getConnectors(boolean bUserOnly)
Get unmodifiable collection of connectors
|
AvatarFeature |
getDefaultAvatar()
Get default avatar
Currently takes first avatar from any connector profile
TODO build avatar inherent to TAK?
|
Connector |
getDefaultConnector(android.content.SharedPreferences prefs)
Get the default connector for this contact, in this order:
1) Check if only a single connector available, if so use it
2) Last user selected connector
3) Use highest priority connector available
|
ActionBroadcastData |
getDefaultProfile()
Get default profile intent
First checks if there is an associated marker (e.g.
|
java.util.List<Contact> |
getFiltered(boolean online,
boolean incParents)
Return a complete list of filtered contacts
This includes descendant contacts
|
java.lang.String[] |
getHierarchyPath()
Get the path to this contact as a string array
Form is [name1, uid1, name2, uid2, ..., nameN, uidN]
This is used specifically for CoT events
|
int |
getIconColor()
Returns the color to be applied to the icon.
|
java.lang.String |
getIconUri()
Returns the URI for the icon for the node.
|
MapItem |
getMapItem() |
java.lang.String |
getParentUID()
Return the UID of this contact's parent
For individual contacts this is "Root"
|
java.lang.Integer |
getPresenceColor()
Get color of presence indicator, or null if not applicable
|
static java.lang.Integer |
getPresenceColor(Contact.UpdateStatus status) |
java.lang.String |
getServerFrom()
Get the preferred connection string for this contact
i.e.
|
int |
getUnreadCount() |
int |
getUnreadCount(Connector connector) |
boolean |
hasConnector(java.lang.String type)
Check if contact has the specified connector type
|
boolean |
hasLocation() |
boolean |
hasProfile() |
boolean |
hideIfEmpty()
Count towards parent children if this item's children is empty
|
boolean |
isChildSupported()
Check if list item can contain children
|
boolean |
isVisible() |
boolean |
onSelected(android.content.SharedPreferences prefs)
If location is available, zoom to it
Otherwise initiate default comms
|
protected void |
refreshImpl()
Refresh implementation to be run on a background thread
If your class doesn't need to refresh then override the filter
method above to avoid unnecessary threading
|
Connector |
removeConnector(java.lang.String type)
Remove the specified connector type
|
void |
setMapItem(MapItem mi) |
void |
setName(java.lang.String name)
Set the display name of the contact
|
void |
setParentUID(java.lang.String uid)
Set the parent UID of this contact
For groups, should typically let addContact handle this
|
void |
stale()
Set status to STALE
|
java.lang.String |
toString() |
boolean |
zoom() |
descendedFrom, dispatchChangeEvent, dispose, getAction, getChildContacts, getDescendantCount, getExtras, getExtraView, getFilteredUIDs, getName, getParent, getParentContacts, getParentHierarchy, getTextColor, getTitle, getUID, getUpdateStatus, getUserObject, notifyListener, refresh, refresh, setDispatch, setExtras, setListener, setUid, setUnreadCount, setUpdateStatus, updateChildren, validChild
async, buildQueryParams, delete, disposeChildren, disposeItems, find, findChild, getAssociationKey, getChildActions, getChildAt, getChildCount, getChildren, getCustomLayout, getDefaultSortModes, getDeleteActions, getDescription, getDropDownSize, getExtraView, getFilter, getFooterView, getHeaderView, getIconDrawable, getListItemView, getLocalData, getLocalData, getPreferredListIndex, getSorts, getVisibility, isDisposed, isGetChildrenSupported, isMultiSelectSupported, notifyListener, postAccept, postRefresh, refresh, refresh, refresh, requestRefresh, requestRefresh, search, setLocalData, setPostFilter, setVisible, sortItems, syncRefresh
public static final java.lang.String DEFAULT_CONNECTOR
protected final java.util.HashMap<java.lang.String,Connector> connectors
public IndividualContact(java.lang.String name)
public IndividualContact(java.lang.String name, java.lang.String uuid)
public IndividualContact(java.lang.String name, java.lang.String uuid, MapItem assocItem)
public IndividualContact(java.lang.String name, java.lang.String uuid, NetConnectString ncs)
public IndividualContact(java.lang.String name, java.lang.String uuid, MapItem assocItem, NetConnectString ncs)
name
- the name of the contactuuid
- the unique identifier for the contactassocItem
- if there is an associated map itemncs
- if provided, connectors are added: IpConnector, GeoChatConnector, MissionPackageConnectorpublic void setName(java.lang.String name)
Contact
public java.lang.String getParentUID()
Contact
getParentUID
in class Contact
public void setParentUID(java.lang.String uid)
Contact
setParentUID
in class Contact
uid
- Parent UIDpublic java.lang.String[] getHierarchyPath()
Contact
getHierarchyPath
in class Contact
public java.util.List<java.lang.String[]> findChildPaths(java.lang.String uid)
Contact
findChildPaths
in class Contact
uid
- Child contact UIDpublic java.util.List<Contact> getFiltered(boolean online, boolean incParents)
Contact
getFiltered
in class Contact
online
- True to only include valid (online) contactsincParents
- True to include contacts that are members
of any parent groupspublic java.lang.String toString()
toString
in class java.lang.Object
public boolean addConnector(Connector connector)
connector
- public Connector getDefaultConnector(android.content.SharedPreferences prefs)
public Connector getConnector(java.lang.String type)
type
- public java.util.Collection<Connector> getConnectors(boolean bUserOnly)
bUserOnly
- true to get only user selectable connectorspublic boolean hasConnector(java.lang.String type)
type
- public Connector removeConnector(java.lang.String type)
type
- public java.lang.String getServerFrom()
public void current()
public void stale()
public void die()
public int getBackgroundColor()
Contact
getBackgroundColor
in class Contact
public java.lang.Integer getPresenceColor()
Contact
getPresenceColor
in class Contact
public static java.lang.Integer getPresenceColor(Contact.UpdateStatus status)
public java.lang.String getIconUri()
HierarchyListItem
getIconUri
in interface HierarchyListItem
getIconUri
in class AbstractHierarchyListItem2
null
if the node
has no icon, or "gone" to remove the icon space entirely.public int getIconColor()
HierarchyListItem
getIconColor
in interface HierarchyListItem
getIconColor
in class AbstractHierarchyListItem2
0xFFFFFFFF
(-1
)
to use the original color.public MapItem getMapItem()
getMapItem
in interface MapItemUser
public void setMapItem(MapItem mi)
public boolean isVisible()
isVisible
in class AbstractHierarchyListItem2
public boolean isChildSupported()
HierarchyListItem
isChildSupported
in interface HierarchyListItem
isChildSupported
in class AbstractHierarchyListItem2
protected void refreshImpl()
AbstractHierarchyListItem2
refreshImpl
in class AbstractHierarchyListItem2
public boolean hideIfEmpty()
HierarchyListItem2
hideIfEmpty
in interface HierarchyListItem2
public AvatarFeature getDefaultAvatar()
public ActionBroadcastData getDefaultProfile()
public boolean hasProfile()
public int getUnreadCount()
getUnreadCount
in class Contact
public int getUnreadCount(Connector connector)
public boolean hasLocation()
public boolean onSelected(android.content.SharedPreferences prefs)
prefs
- public boolean zoom()