public class ContentAdapter
extends android.widget.BaseExpandableListAdapter
| Modifier and Type | Field and Description |
|---|---|
private android.app.Activity |
activity |
private int |
CALL_LOCATION |
private android.content.Context |
context |
private int |
DIRECTIONS |
private java.util.ArrayList<DisplayContent> |
displayContent
ArrayList of content.
|
private int |
EXTERNAL_LINK |
private android.graphics.Typeface |
fontAwesomeFont |
private int |
FOURSQUARE_CONTENT |
private int |
GROUPON_CONTENT |
private android.graphics.Typeface |
robotoLightCondensedFont |
private android.graphics.Typeface |
robotoLightFont |
private android.graphics.Typeface |
robotoThinFont |
| Constructor and Description |
|---|
ContentAdapter(android.app.Activity activity,
java.util.ArrayList<DisplayContent> newDisplayContent)
Constructor for the content adapter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContent(DisplayContent displayContent)
Adds content to ArrayList displayed in the list view.
|
void |
buttonActions(DisplayContent displayContent,
int action)
Switch statement for different button actions.
|
void |
clearContent()
Clears all content from the ArrayList of Content objects.
|
java.lang.Object |
getChild(int groupPosition,
int childPosition) |
long |
getChildId(int groupPosition,
int childPosition) |
int |
getChildrenCount(int groupPosition)
Gets the number of children per group.
|
android.view.View |
getChildView(int groupPosition,
int childPosition,
boolean isLastChild,
android.view.View view,
android.view.ViewGroup parent)
Gets the child view of a group.
|
java.lang.Object |
getGroup(int groupPosition) |
int |
getGroupCount() |
long |
getGroupId(int groupPosition) |
int |
getGroupType(int groupPosition) |
int |
getGroupTypeCount() |
android.view.View |
getGroupView(int groupPosition,
boolean isExpanded,
android.view.View view,
android.view.ViewGroup parent)
Gets the group view in the list view.
|
boolean |
hasStableIds() |
boolean |
isChildSelectable(int groupPosition,
int childPosition) |
private void |
launchFacebook(DisplayContent displayContent)
Launches Facebook activity for updating status.
|
private void |
launchTwitter(DisplayContent displayContent)
Launches Twitter activity for posting tweets.
|
private void |
setListItemButtonFonts(android.view.View view)
Sets the fonts of the button icons in the
expandable list view's children.
|
areAllItemsEnabled, getChildType, getChildTypeCount, getCombinedChildId, getCombinedGroupId, isEmpty, notifyDataSetChanged, notifyDataSetInvalidated, onGroupCollapsed, onGroupExpanded, registerDataSetObserver, unregisterDataSetObserverprivate android.app.Activity activity
private final int CALL_LOCATION
private android.content.Context context
private final int DIRECTIONS
private java.util.ArrayList<DisplayContent> displayContent
private final int EXTERNAL_LINK
private android.graphics.Typeface fontAwesomeFont
private final int FOURSQUARE_CONTENT
private final int GROUPON_CONTENT
private android.graphics.Typeface robotoLightCondensedFont
private android.graphics.Typeface robotoLightFont
private android.graphics.Typeface robotoThinFont
public ContentAdapter(android.app.Activity activity,
java.util.ArrayList<DisplayContent> newDisplayContent)
activity - the activity to add the content to.newDisplayContent - an array list of new content.public void addContent(DisplayContent displayContent)
displayContent - the Content object to add to the ArrayList.public void buttonActions(DisplayContent displayContent, int action)
public void clearContent()
public java.lang.Object getChild(int groupPosition,
int childPosition)
public long getChildId(int groupPosition,
int childPosition)
public int getChildrenCount(int groupPosition)
groupPosition - the position of the group.public android.view.View getChildView(int groupPosition,
int childPosition,
boolean isLastChild,
android.view.View view,
android.view.ViewGroup parent)
groupPosition - the position of the group.childPosition - the position of the child.isLastChild - if the child is last.view - the view.parent - the parent.public java.lang.Object getGroup(int groupPosition)
public int getGroupCount()
public long getGroupId(int groupPosition)
public int getGroupType(int groupPosition)
getGroupType in interface android.widget.HeterogeneousExpandableListgetGroupType in class android.widget.BaseExpandableListAdapterpublic int getGroupTypeCount()
getGroupTypeCount in interface android.widget.HeterogeneousExpandableListgetGroupTypeCount in class android.widget.BaseExpandableListAdapterpublic android.view.View getGroupView(int groupPosition,
boolean isExpanded,
android.view.View view,
android.view.ViewGroup parent)
groupPosition - the position of the group.isExpanded - if the group is expanded or not.view - the view.parent - the parent.public boolean hasStableIds()
public boolean isChildSelectable(int groupPosition,
int childPosition)
private void launchFacebook(DisplayContent displayContent)
displayContent - the content to display.private void launchTwitter(DisplayContent displayContent)
displayContent - the content to display.private void setListItemButtonFonts(android.view.View view)
view - the view.