|
@@ -52,8 +52,9 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
static final String FILTER_MENU_TITLE_TIMESTAMP_ABOVE = "From Date";
|
|
|
static final String FILTER_MENU_TITLE_SORTING = "Sort by";
|
|
|
static final String FILTER_MENU_TITLE_REMOVE = "Reset Filter";
|
|
|
-
|
|
|
- private boolean wasBelowTimePicker;
|
|
|
+ static final String FILTER_MENU_TITLE_GROUP = "Group by";
|
|
|
+
|
|
|
+ private boolean wasBelowTimePicker;
|
|
|
|
|
|
private LogFilter filter;
|
|
|
private boolean showFilterButton;
|
|
@@ -92,12 +93,9 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
if (this.groupingKey == null) this.groupingKey = this.groupingTitles().get(0);
|
|
|
|
|
|
this.setShowFilterButton(!this.filter.isNotEditable());
|
|
|
-
|
|
|
this.addRecordToDB();
|
|
|
|
|
|
View rootView = inflater.inflate(R.layout.fragment_record_list, container, false);
|
|
@@ -122,6 +120,14 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
RecordOverviewFragment.this.openSortingDialog();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ ImageButton groupButton = (ImageButton) rootView.findViewById(R.id.GroupButton);
|
|
|
+ groupButton.setOnClickListener(new View.OnClickListener() {
|
|
|
+ public void onClick(View v) {
|
|
|
+ // Open SortMenu
|
|
|
+ RecordOverviewFragment.this.openGroupingDialog();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
return rootView;
|
|
|
}
|
|
@@ -305,7 +311,11 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
* Open Dialog Methods
|
|
|
*
|
|
|
* ***************************/
|
|
|
-
|
|
|
+
|
|
|
+ private void openGroupingDialog(){
|
|
|
+ ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false , this);
|
|
|
+ newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
|
|
|
+ }
|
|
|
|
|
|
private void openBSSIDFilterDialog(){
|
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID,this.bssids(), this.selectedBSSIDs(), true , this);
|
|
@@ -375,6 +385,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/*****************************
|
|
|
*
|
|
|
* Filter Stuff
|
|
@@ -413,6 +424,16 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
}
|
|
|
return titles;
|
|
|
}
|
|
|
+ public boolean[] selectedGroup(){
|
|
|
+ ArrayList<String> groups = this.groupingTitles();
|
|
|
+ boolean[] selected = new boolean[groups.size()];
|
|
|
+ int i = 0;
|
|
|
+ for(String group : groups){
|
|
|
+ selected[i] =(group.equals(this.groupingKey));
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ return selected;
|
|
|
+ }
|
|
|
|
|
|
public ArrayList<String> protocolTitles(){
|
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
@@ -558,6 +579,10 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
int sortType = this.sortTypeTtiles().indexOf(t);
|
|
|
this.filter.setSorttype(SortType.values()[sortType]);
|
|
|
}
|
|
|
+ if (title.equals(FILTER_MENU_TITLE_GROUP)){
|
|
|
+ ArrayList<String> titles = dialog.getSelectedItemTitles();
|
|
|
+ this.groupingKey = titles.get(0);
|
|
|
+ }
|
|
|
this.populateListViewFromDB(this.expListView);
|
|
|
}
|
|
|
|
|
@@ -612,8 +637,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
Record rec2 = dbh.getRecord(0);
|
|
|
|
|
|
|
|
|
- System.out.println(""+"Could not create logs!");
|
|
|
- System.exit(0);
|
|
|
+ System.out.println("" + "Could not create logs!");
|
|
|
}
|
|
|
|
|
|
}
|