public class ActionMenuData
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
ActionMenuData.PersistedActionMenu |
static class |
ActionMenuData.PreferredMenu |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<ActionMenuData> |
CREATOR |
static java.lang.String |
PLACEHOLDER_TITLE |
Constructor and Description |
---|
ActionMenuData() |
ActionMenuData(ActionMenuData copy) |
ActionMenuData(java.lang.String ref,
java.lang.String title,
java.lang.String iconPath,
java.lang.String enabledIconPath,
java.lang.String selectedIconPath,
java.lang.String preferredMenu,
boolean hideable,
java.util.List<ActionClickData> clickData,
boolean bSelected,
boolean bEnabled,
boolean baseline)
An action menu data item that corresponds with an action or set of actions when the entry
is clicked or long pressed.
|
Modifier and Type | Method and Description |
---|---|
static void |
addIconCache(java.lang.String s,
android.graphics.drawable.Drawable d)
Experimental hook to allow for AirOverlays to poison the cache.
|
static ActionMenuData |
createPlaceholder()
Create a placeholder with a unique broadcast so it .equals() fails,
and each is unique...
|
static ActionMenuData |
createPlaceholder(java.lang.String id)
Create a placeholder with a specific associated id.
|
int |
describeContents() |
boolean |
equals(ActionMenuData c) |
boolean |
equals(java.lang.Object o) |
static ActionMenuData.PersistedActionMenu |
fromItemXml(java.lang.String xml)
Parse the specified action bar string
|
java.util.List<ActionClickData> |
getActionClickData() |
ActionClickData |
getActionClickData(java.lang.String type) |
static java.util.List<ActionMenuData> |
getAllActions(android.content.Context ctx)
In support of reading the actions in use by the
TAK Button Maanger
|
java.lang.String |
getIcon()
Return icon path based on selection state
|
android.graphics.drawable.Drawable |
getIcon(android.content.Context context)
Attempt to create Icon for action
|
int |
getId() |
ActionMenuData.PreferredMenu |
getPreferredMenu() |
java.lang.String |
getRef() |
java.lang.String |
getTitle()
Deprecated.
Use
getTitle(Context) instead
This call will fail to return the resolved string if the map view hasn't
been initialized yet. |
java.lang.String |
getTitle(android.content.Context appContext)
Get the title of this action data
|
boolean |
hasClickData() |
int |
hashCode() |
boolean |
isBaseline() |
boolean |
isEnabled() |
boolean |
isHideable() |
boolean |
isPlaceholder() |
boolean |
isSelected() |
boolean |
isValid() |
static void |
removeIconCache(java.lang.String s)
Experimental hook to allow for AirOverlays remove the poison the cache.
|
void |
setEnabled(boolean enabled) |
void |
setPreferredMenu(ActionMenuData.PreferredMenu preferred) |
void |
setSelected(boolean selected) |
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel parcel,
int flags) |
public static final java.lang.String PLACEHOLDER_TITLE
public static final android.os.Parcelable.Creator<ActionMenuData> CREATOR
public ActionMenuData()
public ActionMenuData(java.lang.String ref, java.lang.String title, java.lang.String iconPath, java.lang.String enabledIconPath, java.lang.String selectedIconPath, java.lang.String preferredMenu, boolean hideable, java.util.List<ActionClickData> clickData, boolean bSelected, boolean bEnabled, boolean baseline)
ref
- the reference for this specific menu item. This should be unique and not mutable.title
- the title of the menu itemiconPath
- the path for the icon, can be a string path or in the case of being called
from a plugin, the string resulting from the call to @see
PluginMapComponent.addPluginIcon(toolDescriptor) and the addPluginIcon uses
the toolDescriptor class getIcon() to return a drawable. This must also
implement the short name and description.enabledIconPath
- the icon when enabled, can be null.selectedIconPath
- the icon when selected, can be null.preferredMenu
- the preferred menu - should be "overflow".hideable
- is the icon hidable by the userclickData
- the click data during a click or longpressbSelected
- selected by defaultbEnabled
- enabled by defaultbaseline
- must be false.public ActionMenuData(ActionMenuData copy)
public static void addIconCache(java.lang.String s, android.graphics.drawable.Drawable d)
s
- is the string that relates to the icon style to be poisoned.d
- the drawable to use.public static void removeIconCache(java.lang.String s)
s
- is the string that relates to the icon style to be unpoisoned.public static ActionMenuData createPlaceholder()
public static ActionMenuData createPlaceholder(java.lang.String id)
id
- Id of the associated actionpublic java.lang.String getRef()
public boolean isSelected()
public void setSelected(boolean selected)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public java.lang.String getTitle(android.content.Context appContext)
appContext
- Application context used for string lookup@Deprecated public java.lang.String getTitle()
getTitle(Context)
instead
This call will fail to return the resolved string if the map view hasn't
been initialized yet.public java.lang.String getIcon()
public android.graphics.drawable.Drawable getIcon(android.content.Context context) throws android.content.res.Resources.NotFoundException
context
- android.content.res.Resources.NotFoundException
public ActionMenuData.PreferredMenu getPreferredMenu()
public void setPreferredMenu(ActionMenuData.PreferredMenu preferred)
public boolean isHideable()
public boolean isPlaceholder()
public boolean isBaseline()
public ActionClickData getActionClickData(java.lang.String type)
public java.util.List<ActionClickData> getActionClickData()
public boolean hasClickData()
public boolean isValid()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(ActionMenuData c)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int getId()
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel parcel, int flags)
writeToParcel
in interface android.os.Parcelable
public static java.util.List<ActionMenuData> getAllActions(android.content.Context ctx)
ctx
- public static ActionMenuData.PersistedActionMenu fromItemXml(java.lang.String xml)
xml
- the xml to turn into a action menu