I have a layout where I have an expandable list in a fragment on the left and a details fragment on the right. This all works fine.
Now I would like to indicate what
You can save the current view and change the background color of view within your click listeners:
View currentView;
ExpandableListView elv;
elv.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
if(currentView != null) {
currentView.setBackgroundColor(Color.parseColor("#FFFFFF"));
}
v.setBackgroundColor(Color.parseColor("#EEEEEE"));
currentDrawerView = view;
//do something
return false;
}
});
elv.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
if(currentView != null) {
currentView.setBackgroundColor(Color.parseColor("#FFFFFF"));
}
v.setBackgroundColor(Color.parseColor("#EEEEEE"));
currentDrawerView = view;
//do something
return false;
}
});