|
@@ -72,6 +72,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
UglyDbHelper dbh;
|
|
UglyDbHelper dbh;
|
|
|
|
|
|
private String sectionToOpen = "";
|
|
private String sectionToOpen = "";
|
|
|
|
+ private ArrayList<Integer> openSections;
|
|
|
|
|
|
public void setFilter(LogFilter filter){
|
|
public void setFilter(LogFilter filter){
|
|
this.filter = filter;
|
|
this.filter = filter;
|
|
@@ -119,28 +120,20 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
View rootView = inflater.inflate(this.getLayoutId(), container, false);
|
|
View rootView = inflater.inflate(this.getLayoutId(), container, false);
|
|
ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
|
|
ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
|
|
|
|
|
|
- ArrayList<Integer> openSections = new ArrayList<Integer>();
|
|
|
|
- if(this.expListView != null){
|
|
|
|
- int numOfGroups = this.expListView.getExpandableListAdapter().getGroupCount();
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < numOfGroups; i++){
|
|
|
|
- boolean isOpen = this.expListView.isGroupExpanded(i);
|
|
|
|
- if (isOpen){
|
|
|
|
- openSections.add(i);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
this.expListView = mylist;
|
|
this.expListView = mylist;
|
|
populateListViewFromDB(mylist);
|
|
populateListViewFromDB(mylist);
|
|
|
|
|
|
- if (openSections.size() != 0){
|
|
|
|
- for (int i = 0; i < openSections.size(); i++){
|
|
|
|
- int index = openSections.get(i);
|
|
|
|
|
|
+ if (this.openSections != null && this.openSections.size() != 0){
|
|
|
|
+ for (int i = 0; i < this.openSections.size(); i++){
|
|
|
|
+ int index = this.openSections.get(i);
|
|
this.expListView.expandGroup(index);
|
|
this.expListView.expandGroup(index);
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ this.openSections = new ArrayList<Integer>();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //this.expListView.smoothScrollToPosition(scrollPosition);
|
|
|
|
+
|
|
registerListClickCallback(mylist);
|
|
registerListClickCallback(mylist);
|
|
|
|
|
|
ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
|
|
ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
|
|
@@ -351,7 +344,18 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ mylist.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onGroupExpand(int i) {
|
|
|
|
+ RecordOverviewFragment.this.openSections.add(i);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ mylist.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onGroupCollapse(int i) {
|
|
|
|
+ RecordOverviewFragment.this.openSections.remove(i);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|