public abstract class

ArcGISAttributesAdapter

extends Object
implements Adapter
java.lang.Object
   ↳ com.esri.android.map.popup.ArcGISAttributesAdapter
Known Direct Subclasses

Class Overview

Abstract adapter class to display graphic attributes in the popup. Applications can subclass this class to implement their own way to display feature's attributes.

Summary

Nested Classes
class ArcGISAttributesAdapter.AttributeInfo Class gathering all information regarding an attribute 
enum ArcGISAttributesAdapter.FIELD_TYPE  
class ArcGISAttributesAdapter.FieldLabelView Default view class to display an attribute label  
class ArcGISAttributesAdapter.LayoutResource This class is used to create a layout based on a field type 
class ArcGISAttributesAdapter.SeparatorView Default view class to display a separator  
Constants
int DEFAULT_CODED_VALUE_LAYOUT
int DEFAULT_DATE_LAYOUT
int DEFAULT_EDIT_TEXT_LAYOUT
int DEFAULT_RANGE_VALUE_LAYOUT
int FIELD_LABEL_ID
int FIELD_VALUE_ID
[Expand]
Inherited Constants
From interface android.widget.Adapter
Fields
protected Map<String, Object> mAttributes
protected ArcGISAttributesAdapter.LayoutResource mCodedValueResource
protected Context mContext
protected int mDatePickerResourceId
protected ArcGISAttributesAdapter.LayoutResource mDateResource
protected ArcGISAttributesAdapter.LayoutResource mEditTextResource
protected FeatureType mFeatureType
protected Popup mPopup
protected ArcGISAttributesAdapter.LayoutResource mRangeValueResource
protected ArcGISValueFormat mValueFormat
Public Methods
boolean areAllItemsEnabled()
Are all items enabled.
String getAttributeName(int position)
Gets the attribute name.
Object getAttributeValue(String attributeName)
Gets the attribute value.
int getCount()
Object getItem(int position)
long getItemId(int position)
int getItemViewType(int position)
int getViewTypeCount()
boolean hasStableIds()
boolean isEmpty()
boolean isEnabled(int position)
Checks if is enabled.
void notifyDataSetChanged()
Notifies the attached View that the underlying data has been changed and it should refresh itself.
void notifyDataSetInvalidated()
Notify data set invalidated.
abstract void refresh()
Perform housekeeping when needed
void registerDataSetObserver(DataSetObserver observer)
void reset()
Reset the attributes to their initial value.
void setCodedValueLayoutResourceId(int id, int labelViewId, int valueViewId)
Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.CODED_VALUE_DOMAIN.
void setDateLayoutResourceId(int id, int labelViewId, int valueViewId)
Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.DATE.
void setDatePickerLayoutResourceId(int id)
Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.DATE when the button is clicked and the date/time picker is displayed.
void setEditTextLayoutResourceId(int id, int labelViewId, int valueViewId)
Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.TEXT.
void setRangeValueLayoutResourceId(int id, int labelViewId, int valueViewId)
Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.RANGE_DOMAIN.
void unregisterDataSetObserver(DataSetObserver observer)
Protected Methods
abstract ViewGroup createDefaultLayout(ArcGISAttributesAdapter.FIELD_TYPE fieldType)
Creates a default layout for this adapter based on the field type
ArcGISAttributesAdapter.FIELD_TYPE determineFieldType(ArcGISAttributesAdapter.AttributeInfo attributeInfo)
Convenience method to determine the type of an attribute
ArcGISAttributesAdapter.AttributeInfo getAttributeInfo(int position)
Returns the ArcGISAttributesAdapter.AttributeInfo for an attribute based on its position in this adapter
ArcGISAttributesAdapter.LayoutResource getLayoutResource(ArcGISAttributesAdapter.FIELD_TYPE fieldType)
Returns a layout resource based on the field type
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.widget.Adapter

Constants

protected static final int DEFAULT_CODED_VALUE_LAYOUT

Constant Value: -2 (0xfffffffe)

protected static final int DEFAULT_DATE_LAYOUT

Constant Value: -4 (0xfffffffc)

protected static final int DEFAULT_EDIT_TEXT_LAYOUT

Constant Value: -5 (0xfffffffb)

protected static final int DEFAULT_RANGE_VALUE_LAYOUT

Constant Value: -3 (0xfffffffd)

protected static final int FIELD_LABEL_ID

Constant Value: 1 (0x00000001)

protected static final int FIELD_VALUE_ID

Constant Value: 2 (0x00000002)

Fields

protected Map<String, Object> mAttributes

protected ArcGISAttributesAdapter.LayoutResource mCodedValueResource

protected Context mContext

protected int mDatePickerResourceId

protected ArcGISAttributesAdapter.LayoutResource mDateResource

protected ArcGISAttributesAdapter.LayoutResource mEditTextResource

protected FeatureType mFeatureType

protected Popup mPopup

protected ArcGISAttributesAdapter.LayoutResource mRangeValueResource

protected ArcGISValueFormat mValueFormat

Public Methods

public boolean areAllItemsEnabled ()

Are all items enabled.

Returns
boolean true, if are all items enabled

public String getAttributeName (int position)

Gets the attribute name.

Parameters
position int: the position
Returns
String the attribute name

public Object getAttributeValue (String attributeName)

Gets the attribute value.

Parameters
attributeName String: the attribute name
Returns
Object the attribute value

public int getCount ()

Returns
int

public Object getItem (int position)

Parameters
position int
Returns
Object

public long getItemId (int position)

Parameters
position int
Returns
long

public int getItemViewType (int position)

Parameters
position int
Returns
int

public int getViewTypeCount ()

Returns
int

public boolean hasStableIds ()

Returns
boolean

public boolean isEmpty ()

Returns
boolean

public boolean isEnabled (int position)

Checks if is enabled.

Parameters
position int: the position
Returns
boolean true, if checks if is enabled

public void notifyDataSetChanged ()

Notifies the attached View that the underlying data has been changed and it should refresh itself.

public void notifyDataSetInvalidated ()

Notify data set invalidated.

public abstract void refresh ()

Perform housekeeping when needed

public void registerDataSetObserver (DataSetObserver observer)

Parameters
observer DataSetObserver

public void reset ()

Reset the attributes to their initial value.

public void setCodedValueLayoutResourceId (int id, int labelViewId, int valueViewId)

Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.CODED_VALUE_DOMAIN.

Parameters
id int: the resource id for the layout
labelViewId int: the resource id for the TextView used to display the field label
valueViewId int: the resource id for the Spinner used to display the field value

public void setDateLayoutResourceId (int id, int labelViewId, int valueViewId)

Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.DATE.

Parameters
id int: the resource id for the layout
labelViewId int: the resource id for the TextView used to display the field label
valueViewId int: the resource id for the Button used to display the field value

public void setDatePickerLayoutResourceId (int id)

Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.DATE when the button is clicked and the date/time picker is displayed.

Parameters
id int: the resource id for the layout

public void setEditTextLayoutResourceId (int id, int labelViewId, int valueViewId)

Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.TEXT.

Parameters
id int: the resource id for the layout
labelViewId int: the resource id for the TextView used to display the field label
valueViewId int: the resource id for the TextView used to display the field value

public void setRangeValueLayoutResourceId (int id, int labelViewId, int valueViewId)

Sets a layout id (defined in the resources of the project) for the field type FIELD_TYPE.RANGE_DOMAIN.

Parameters
id int: the resource id for the layout
labelViewId int: the resource id for the TextView used to display the field label
valueViewId int: the resource id for the Spinner used to display the field value

public void unregisterDataSetObserver (DataSetObserver observer)

Parameters
observer DataSetObserver

Protected Methods

protected abstract ViewGroup createDefaultLayout (ArcGISAttributesAdapter.FIELD_TYPE fieldType)

Creates a default layout for this adapter based on the field type

Parameters
fieldType ArcGISAttributesAdapter.FIELD_TYPE: the ArcGISAttributesAdapter.FIELD_TYPE
Returns
ViewGroup a layout (ViewGroup)

protected ArcGISAttributesAdapter.FIELD_TYPE determineFieldType (ArcGISAttributesAdapter.AttributeInfo attributeInfo)

Convenience method to determine the type of an attribute

Parameters
attributeInfo ArcGISAttributesAdapter.AttributeInfo: the information for an attribute
Returns
ArcGISAttributesAdapter.FIELD_TYPE a ArcGISAttributesAdapter.FIELD_TYPE

protected ArcGISAttributesAdapter.AttributeInfo getAttributeInfo (int position)

Returns the ArcGISAttributesAdapter.AttributeInfo for an attribute based on its position in this adapter

Parameters
position int: in this adapter
Returns
ArcGISAttributesAdapter.AttributeInfo an ArcGISAttributesAdapter.AttributeInfo

protected ArcGISAttributesAdapter.LayoutResource getLayoutResource (ArcGISAttributesAdapter.FIELD_TYPE fieldType)

Returns a layout resource based on the field type

Parameters
fieldType ArcGISAttributesAdapter.FIELD_TYPE: the ArcGISAttributesAdapter.FIELD_TYPE
Returns
ArcGISAttributesAdapter.LayoutResource a layer resource