|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCursorTreeAdapter
es.ugr.swad.swadroid.modules.groups.GroupsCursorTreeAdapter
public class GroupsCursorTreeAdapter
Adapter to populate with cursors data an expandable list. The groups represent group types and their child represent every group of this group type. There are two kind of layout: one for the groups and one for the childs
Field Summary | |
---|---|
private java.util.HashMap<java.lang.Long,java.lang.Integer> |
childChecked
|
private java.util.HashMap<java.lang.Long,Cursor> |
childCursors
|
private int |
childLayout
|
private java.util.HashMap<java.lang.Long,java.lang.Integer> |
childMultiple
|
private int |
groupLayout
|
private Cursor |
groupsCursor
|
private LayoutInflater |
mInflater
|
Constructor Summary | |
---|---|
GroupsCursorTreeAdapter(Context context,
Cursor groupsCursor,
java.util.HashMap<java.lang.Long,Cursor> childCursors,
int groupLayout,
int childlayout)
Constructor |
Method Summary | |
---|---|
protected void |
bindChildView(View view,
Context context,
Cursor cursor,
boolean isLastChild)
|
protected void |
bindGroupView(View view,
Context context,
Cursor cursor,
boolean isExpanded)
|
boolean |
checkItem(int groupPosition,
int childPosition)
The implementation of expandable list recycle the view. |
protected Cursor |
getChildrenCursor(Cursor groupCursor)
|
java.lang.String |
getChosenGroupCodes()
|
private void |
getMultipleGroups()
|
boolean |
isChildSelectable(int groupPosition,
int childPosition)
|
protected View |
newChildView(Context context,
Cursor cursor,
boolean isLastChild,
ViewGroup parent)
|
protected View |
newGroupView(Context context,
Cursor cursor,
boolean isExpanded,
ViewGroup parent)
|
void |
resetChecked()
Set the initial selected items to groups to which the user is actually enrolled. |
private void |
setCheckedStateToDB()
Until the user clicks on any groups, the selected items are the groups to which the user is actually enrolled, like the database shows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private LayoutInflater mInflater
private int groupLayout
private int childLayout
private Cursor groupsCursor
private java.util.HashMap<java.lang.Long,Cursor> childCursors
private java.util.HashMap<java.lang.Long,java.lang.Integer> childChecked
private java.util.HashMap<java.lang.Long,java.lang.Integer> childMultiple
Constructor Detail |
---|
public GroupsCursorTreeAdapter(Context context, Cursor groupsCursor, java.util.HashMap<java.lang.Long,Cursor> childCursors, int groupLayout, int childlayout)
context
- The context
groupsCursor
- cursor over the database with data of group types.
childCursors
- Map the group types id and the cursor that contains all the groups of this
group type.
groupLayout
- Layout for groups
childLayou
- Layout for child's
Method Detail |
---|
private void getMultipleGroups()
private void setCheckedStateToDB()
public void resetChecked()
protected void bindChildView(View view, Context context, Cursor cursor, boolean isLastChild)
protected void bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded)
protected Cursor getChildrenCursor(Cursor groupCursor)
protected View newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent)
protected View newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent)
public boolean checkItem(int groupPosition, int childPosition)
public boolean isChildSelectable(int groupPosition, int childPosition)
public java.lang.String getChosenGroupCodes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |