|
@@ -239,6 +239,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
/**Initialises the expandable list view in a backgorund thread*/
|
|
/**Initialises the expandable list view in a backgorund thread*/
|
|
private void initialiseListView(){
|
|
private void initialiseListView(){
|
|
if (loader != null) loader.interrupt();
|
|
if (loader != null) loader.interrupt();
|
|
|
|
+ if (this.openSections == null) this.openSections = new ArrayList<Integer>();
|
|
|
|
|
|
this.spinner.setVisibility(View.VISIBLE);
|
|
this.spinner.setVisibility(View.VISIBLE);
|
|
|
|
|
|
@@ -264,6 +265,9 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
|
|
|
if (adapter.getGroupCount() >= 1){
|
|
if (adapter.getGroupCount() >= 1){
|
|
RecordOverviewFragment.this.expListView.expandGroup(DEFAULT_GROUPING_KEY_INDEX);
|
|
RecordOverviewFragment.this.expListView.expandGroup(DEFAULT_GROUPING_KEY_INDEX);
|
|
|
|
+ if (!RecordOverviewFragment.this.openSections.contains(DEFAULT_GROUPING_KEY_INDEX)){
|
|
|
|
+ RecordOverviewFragment.this.openSections.add(DEFAULT_GROUPING_KEY_INDEX);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
RecordOverviewFragment.this.setSectionToOpen(RecordOverviewFragment.this.sectionToOpen);
|
|
RecordOverviewFragment.this.setSectionToOpen(RecordOverviewFragment.this.sectionToOpen);
|
|
}
|
|
}
|
|
@@ -379,7 +383,15 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void onDestroy(){
|
|
|
|
+ if (mReceiver != null){
|
|
|
|
+ }
|
|
|
|
+ super.onDestroy();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
// Inflate the menu items for use in the action bar
|
|
// Inflate the menu items for use in the action bar
|
|
inflater.inflate(R.menu.records_overview_actions, menu);
|
|
inflater.inflate(R.menu.records_overview_actions, menu);
|
|
@@ -450,11 +462,15 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
// Use the Builder class for convenient dialog construction
|
|
// Use the Builder class for convenient dialog construction
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
|
|
|
|
- String deleteAttacksTitle = MainActivity.getInstance().getString(R.string.deleteAttacksTitle);
|
|
|
|
|
|
+ String deleteFILTEREDAttacksTitle = MainActivity.getInstance().getString(R.string.deleteFILTEREDAttacksTitle);
|
|
|
|
+ String deleteALLAttacksTitle = MainActivity.getInstance().getString(R.string.deleteALLAttacksTitle);
|
|
|
|
+
|
|
String cancelTitle = MainActivity.getInstance().getString(R.string.cancel);
|
|
String cancelTitle = MainActivity.getInstance().getString(R.string.cancel);
|
|
String deleteTitle = MainActivity.getInstance().getString(R.string.delete);
|
|
String deleteTitle = MainActivity.getInstance().getString(R.string.delete);
|
|
|
|
|
|
- builder.setMessage(deleteAttacksTitle)
|
|
|
|
|
|
+ String text = this.filter.isSet()? deleteFILTEREDAttacksTitle : deleteALLAttacksTitle;
|
|
|
|
+
|
|
|
|
+ builder.setMessage(text)
|
|
.setPositiveButton(deleteTitle, new DialogInterface.OnClickListener() {
|
|
.setPositiveButton(deleteTitle, new DialogInterface.OnClickListener() {
|
|
private RecordOverviewFragment recordOverviewFragment = null;
|
|
private RecordOverviewFragment recordOverviewFragment = null;
|
|
public void onClick(DialogInterface dialog, int id) {
|
|
public void onClick(DialogInterface dialog, int id) {
|
|
@@ -662,12 +678,19 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
this.actualiseUI();
|
|
this.actualiseUI();
|
|
}
|
|
}
|
|
private void actualiseUI(){
|
|
private void actualiseUI(){
|
|
|
|
+ RecordOverviewFragment self = RecordOverviewFragment.this;
|
|
if (adapter != null){
|
|
if (adapter != null){
|
|
- RecordOverviewFragment.this.expListView.setAdapter(adapter);
|
|
|
|
|
|
+ self.expListView.setAdapter(adapter);
|
|
adapter.notifyDataSetChanged();
|
|
adapter.notifyDataSetChanged();
|
|
- RecordOverviewFragment.this.spinner.setVisibility(View.GONE);
|
|
|
|
|
|
+ self.spinner.setVisibility(View.GONE);
|
|
|
|
+ }
|
|
|
|
+ self.showEmptyDataNotification();
|
|
|
|
+ if (self.openSections != null && self.expListView != null){
|
|
|
|
+ for (int i = 0; i < self.openSections.size(); i++){
|
|
|
|
+ int index = self.openSections.get(i);
|
|
|
|
+ self.expListView.expandGroup(index);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- RecordOverviewFragment.this.showEmptyDataNotification();
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -707,6 +730,9 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
int section = this.getGroupTitles().indexOf(this.sectionToOpen);
|
|
int section = this.getGroupTitles().indexOf(this.sectionToOpen);
|
|
this.expListView.expandGroup(section);
|
|
this.expListView.expandGroup(section);
|
|
this.sectionToOpen = "";
|
|
this.sectionToOpen = "";
|
|
|
|
+ if (!this.openSections.contains(section)){
|
|
|
|
+ RecordOverviewFragment.this.openSections.add(section);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -749,13 +775,15 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
mylist.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
|
mylist.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
|
@Override
|
|
@Override
|
|
public void onGroupExpand(int i) {
|
|
public void onGroupExpand(int i) {
|
|
- RecordOverviewFragment.this.openSections.add(new Integer(i));
|
|
|
|
|
|
+ if (!RecordOverviewFragment.this.openSections.contains(i)){
|
|
|
|
+ RecordOverviewFragment.this.openSections.add(i);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
mylist.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
|
mylist.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
|
@Override
|
|
@Override
|
|
public void onGroupCollapse(int i) {
|
|
public void onGroupCollapse(int i) {
|
|
- RecordOverviewFragment.this.openSections.remove(new Integer(i));
|
|
|
|
|
|
+ RecordOverviewFragment.this.openSections.remove(i);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|