public abstract class AbstractHierarchyListItem2 extends java.lang.Object implements HierarchyListItem2, HashtagSearch
HierarchyListItem.ComparatorSort, HierarchyListItem.Sort, HierarchyListItem.SortAlphabet, HierarchyListItem.SortAlphabetDesc, HierarchyListItem.SortDistanceFrom| Modifier and Type | Field and Description |
|---|---|
protected boolean |
asyncRefresh |
protected java.util.List<HierarchyListItem> |
children |
protected boolean |
disposed |
protected HierarchyListFilter |
filter |
protected android.widget.BaseAdapter |
listener |
protected HierarchyListFilter |
postFilter |
protected boolean |
reusable |
protected android.os.Handler |
uiHandler |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractHierarchyListItem2() |
| Modifier and Type | Method and Description |
|---|---|
static void |
async(java.lang.Runnable r) |
protected static FeatureDataStore.FeatureQueryParameters |
buildQueryParams(HierarchyListFilter filter) |
boolean |
delete()
Execute all delete actions defined in this class
|
void |
dispose()
Unregister any listeners,
|
protected void |
disposeChildren()
Call dispose on all children and clear
|
protected static void |
disposeItems(java.util.List<HierarchyListItem> items)
Call dispose on list of items
|
java.util.Set<HierarchyListItem> |
find(java.lang.String terms) |
HierarchyListItem |
findChild(java.lang.String uid)
Find child based on matching UID
|
<T extends Action> |
getAction(java.lang.Class<T> clazz)
Returns an instance of the specified action that can be used to interact with the node's
underlying content.
|
java.lang.String |
getAssociationKey()
Get settings screen association key (see DropDownReceiver)
|
<T extends Action> |
getChildActions(java.lang.Class<T> clazz)
Get actions of a certain type from all children items
|
HierarchyListItem |
getChildAt(int index)
Returns the child node at the specified index.
|
int |
getChildCount()
Returns the number of children that this node has.
|
java.util.List<HierarchyListItem> |
getChildren()
Return a copy of the children list (post-filtered)
|
android.view.View |
getCustomLayout()
Get a custom view for the entire OM drop-down
This is smoother than switching between drop-downs using intents
|
static java.util.List<HierarchyListItem.Sort> |
getDefaultSortModes(HierarchyListItem list)
Get list of sort modes based on supported actions
|
java.util.List<Delete> |
getDeleteActions()
Get the list of delete actions in this class
Meant to serve as a default implementation of
GroupDelete.getDeleteActions() |
java.lang.String |
getDescription()
Get the item description (shown in gray under the title)
|
double[] |
getDropDownSize()
Get the preferred drop-down size for displaying this list
Width is used in landscape mode, height is used in portrait mode
|
android.view.View |
getExtraView()
Returns the extra view, if any, associated with the node.
|
android.view.View |
getExtraView(android.view.View convertView,
android.view.ViewGroup parent)
Same as
HierarchyListItem.getExtraView() except the existing view is provided
This is to allow more efficient view cycling when scrolling through OM |
protected static HierarchyListFilter |
getFilter(HierarchyListFilter filter,
java.lang.Class<?> clazz) |
android.view.View |
getFooterView()
Get the custom footer view for this list
|
android.view.View |
getHeaderView()
Get the custom header view for this list
|
int |
getIconColor()
Returns the color to be applied to the icon.
|
android.graphics.drawable.Drawable |
getIconDrawable()
Get the icon drawable
|
java.lang.String |
getIconUri()
Returns the URI for the icon for the node.
|
android.view.View |
getListItemView(android.view.View convertView,
android.view.ViewGroup parent)
Used when this item is being displayed within a list
For overriding the entire list view, see
HierarchyListItem2.getCustomLayout() |
java.lang.Object |
getLocalData(java.lang.String s)
Returns the local data associated with the node for the specified key.
|
<T> T |
getLocalData(java.lang.String s,
java.lang.Class<T> clazz)
Returns the local data associated with the node for the specified key.
|
int |
getPreferredListIndex()
Returns the preferred index in the list for the item to be displayed at.
|
java.util.List<HierarchyListItem.Sort> |
getSorts()
Return all applicable sort modes for this list
|
java.lang.String |
getUID()
Returns the unique ID of the list item
|
int |
getVisibility()
Typical calculation for determining ternary visibility
Note that this class does not implement Visibility or Visibility2
|
boolean |
isChildSupported()
Check if list item can contain children
|
boolean |
isDisposed()
Check whether this item has been disposed or not
|
boolean |
isGetChildrenSupported() |
boolean |
isMultiSelectSupported()
Does this list support multi-selection of its items?
|
boolean |
isVisible() |
protected void |
notifyListener() |
protected void |
notifyListener(boolean sizeChanged)
Notify the listener adapter
If the adapter is part of Overlay Manager, include reference to self
so we know which item has been updated
|
protected boolean |
postAccept(HierarchyListItem item)
Used for post-filtering items after refresh has been done
Useful in situations where the results of the refresh may
influence the results of a secondary filtering process
|
protected void |
postRefresh(java.lang.Runnable r)
Submit runnable to refresh thread pool
|
void |
refresh(android.widget.BaseAdapter listener,
HierarchyListFilter filter)
Update this item's listener and refresh
|
HierarchyListFilter |
refresh(HierarchyListFilter filter)
Send a refresh request to the thread pool
|
HierarchyListItem.Sort |
refresh(HierarchyListItem.Sort sort)
Deprecated.
This method will become final
|
protected static void |
refresh(HierarchyListItem item,
HierarchyListFilter filter) |
protected abstract 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
|
protected void |
requestRefresh()
Request a refresh of Overlay Manager's current list
|
protected void |
requestRefresh(java.lang.String path)
Request a refresh of Overlay Manager's current list provided
the current path is directly above or below 'path'
|
java.util.Collection<HashtagContent> |
search(java.util.Collection<java.lang.String> searchTags)
Search for content based on tags
|
java.lang.Object |
setLocalData(java.lang.String s,
java.lang.Object o)
Sets the specified local data on the object.
|
void |
setPostFilter(HierarchyListFilter filter)
Set the post-filter
|
boolean |
setVisible(boolean visible) |
void |
sortItems(java.util.List<HierarchyListItem> items)
Sort the list of items based on this.filter.sort
Unlike the function above, this requires no synchronization
(unless called on this.children, which isn't recommended)
|
void |
syncRefresh(android.widget.BaseAdapter listener,
HierarchyListFilter filter)
Call a refresh synchronously, regardless of the asyncRefresh value
|
protected void |
updateChildren(java.util.List<HierarchyListItem> items)
Copy a list of items to the children array on the UI thread
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithideIfEmptygetDescendantCount, getTitle, getUserObjectprotected final java.util.List<HierarchyListItem> children
protected HierarchyListFilter filter
protected HierarchyListFilter postFilter
protected android.widget.BaseAdapter listener
protected boolean asyncRefresh
protected boolean disposed
protected boolean reusable
protected final android.os.Handler uiHandler
public java.lang.String getUID()
HierarchyListItemgetUID in interface HierarchyListItempublic int getPreferredListIndex()
HierarchyListItemgetPreferredListIndex in interface HierarchyListItem-1 to indicate no preference
(FIFO).public boolean isChildSupported()
HierarchyListItemisChildSupported in interface HierarchyListItempublic HierarchyListItem getChildAt(int index)
HierarchyListItemgetChildAt in interface HierarchyListItemindex - The indexpublic int getChildCount()
HierarchyListItemgetChildCount in interface HierarchyListItemprotected boolean postAccept(HierarchyListItem item)
item - Item to filterpublic void setPostFilter(HierarchyListFilter filter)
public java.lang.String getDescription()
HierarchyListItem2getDescription in interface HierarchyListItem2public android.graphics.drawable.Drawable getIconDrawable()
HierarchyListItem2getIconDrawable in interface HierarchyListItem2public int getIconColor()
HierarchyListItemgetIconColor in interface HierarchyListItem0xFFFFFFFF (-1)
to use the original color.public java.lang.String getIconUri()
HierarchyListItemgetIconUri in interface HierarchyListItemnull if the node
has no icon, or "gone" to remove the icon space entirely.public boolean isMultiSelectSupported()
HierarchyListItem2isMultiSelectSupported in interface HierarchyListItem2public java.lang.String getAssociationKey()
HierarchyListItem2getAssociationKey in interface HierarchyListItem2public android.view.View getExtraView()
HierarchyListItemgetExtraView in interface HierarchyListItemnull if there is no view.public android.view.View getExtraView(android.view.View convertView,
android.view.ViewGroup parent)
HierarchyListItem2HierarchyListItem.getExtraView() except the existing view is provided
This is to allow more efficient view cycling when scrolling through OMgetExtraView in interface HierarchyListItem2convertView - The existing extra view. Only inflate a new layout
if the id/context do not match your expected config.parent - The extra view parent - Use this as "root" when inflatingpublic android.view.View getCustomLayout()
HierarchyListItem2getCustomLayout in interface HierarchyListItem2public android.view.View getHeaderView()
HierarchyListItem2getHeaderView in interface HierarchyListItem2public android.view.View getFooterView()
HierarchyListItem2getFooterView in interface HierarchyListItem2public android.view.View getListItemView(android.view.View convertView,
android.view.ViewGroup parent)
HierarchyListItem2HierarchyListItem2.getCustomLayout()getListItemView in interface HierarchyListItem2convertView - The existing list item view. Only inflate a new layout
if the id/context do not match your expected config.parent - The list view parent - Use this as "root" when inflatingpublic double[] getDropDownSize()
HierarchyListItem2getDropDownSize in interface HierarchyListItem2public final java.lang.Object setLocalData(java.lang.String s,
java.lang.Object o)
HierarchyListItemsetLocalData in interface HierarchyListItems - The key for the datao - The value for the datapublic final java.lang.Object getLocalData(java.lang.String s)
HierarchyListItemgetLocalData in interface HierarchyListItems - The key for the local datapublic final <T> T getLocalData(java.lang.String s,
java.lang.Class<T> clazz)
HierarchyListItemgetLocalData in interface HierarchyListItems - The key for the local dataclazz - The return type for the dataT.public <T extends Action> T getAction(java.lang.Class<T> clazz)
HierarchyListItemgetAction in interface HierarchyListItemclazz - The action classnull if the specified
action is not supported for the node.public java.util.List<HierarchyListItem.Sort> getSorts()
HierarchyListItem2getSorts in interface HierarchyListItem2public static java.util.List<HierarchyListItem.Sort> getDefaultSortModes(HierarchyListItem list)
list - List itempublic <T extends Action> java.util.List<T> getChildActions(java.lang.Class<T> clazz)
T - Action typeclazz - Action classpublic int getVisibility()
public boolean isVisible()
public boolean setVisible(boolean visible)
public boolean delete()
public java.util.List<Delete> getDeleteActions()
GroupDelete.getDeleteActions()public java.util.Set<HierarchyListItem> find(java.lang.String terms)
public HierarchyListFilter refresh(HierarchyListFilter filter)
refresh in interface HierarchyListItem2filter - The new filterpublic void refresh(android.widget.BaseAdapter listener,
HierarchyListFilter filter)
listener - New listenerfilter - New filterpublic void syncRefresh(android.widget.BaseAdapter listener,
HierarchyListFilter filter)
listener - Listenerfilter - Refresh filterprotected void requestRefresh()
protected void requestRefresh(java.lang.String path)
path - Backslash-delimited path of list UIDs@Deprecated public HierarchyListItem.Sort refresh(HierarchyListItem.Sort sort)
refresh in interface HierarchyListItemrefresh in interface HierarchyListItem2sort - Sort object (usually this.filter.sort)public void sortItems(java.util.List<HierarchyListItem> items)
items - List of itemsprotected void updateChildren(java.util.List<HierarchyListItem> items)
items - List of filtered/sorted itemspublic java.util.List<HierarchyListItem> getChildren()
public boolean isGetChildrenSupported()
public HierarchyListItem findChild(java.lang.String uid)
uid - UID to search forprotected void notifyListener(boolean sizeChanged)
protected void notifyListener()
protected void postRefresh(java.lang.Runnable r)
r - Runnable to submit to background threadpublic static void async(java.lang.Runnable r)
public void dispose()
HierarchyListItem2dispose in interface HierarchyListItem2public boolean isDisposed()
protected void disposeChildren()
protected abstract void refreshImpl()
public java.util.Collection<HashtagContent> search(java.util.Collection<java.lang.String> searchTags)
HashtagSearchsearch in interface HashtagSearchsearchTags - List of hashtags to search forprotected static void disposeItems(java.util.List<HierarchyListItem> items)
items - List of itemsprotected static void refresh(HierarchyListItem item, HierarchyListFilter filter)
protected static HierarchyListFilter getFilter(HierarchyListFilter filter, java.lang.Class<?> clazz)
protected static FeatureDataStore.FeatureQueryParameters buildQueryParams(HierarchyListFilter filter)