|
@@ -6,6 +6,7 @@ import android.app.FragmentManager;
|
|
import android.app.FragmentTransaction;
|
|
import android.app.FragmentTransaction;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
|
+import android.content.res.Configuration;
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
@@ -147,12 +148,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void onCreate(Bundle savedInstanceState) {
|
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
|
- setHasOptionsMenu(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private ImageButton getFilterButton(){
|
|
private ImageButton getFilterButton(){
|
|
return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
|
|
return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
|
|
}
|
|
}
|
|
@@ -205,6 +200,38 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
return rootView;
|
|
return rootView;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void onCreate(Bundle savedInstanceState) {
|
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
|
+ setHasOptionsMenu(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onConfigurationChanged(Configuration newConfig){
|
|
|
|
+ super.onConfigurationChanged(newConfig);
|
|
|
|
+ LayoutInflater inflater = LayoutInflater.from(getActivity());
|
|
|
|
+
|
|
|
|
+ ViewGroup container = (ViewGroup) this.getView();
|
|
|
|
+ container.removeAllViewsInLayout();
|
|
|
|
+ View rootView = inflater.inflate(this.getLayoutID(), container, false);
|
|
|
|
+
|
|
|
|
+ container.addView(rootView);
|
|
|
|
+
|
|
|
|
+ LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
|
|
|
|
+ plotLayout.setWillNotDraw(false);
|
|
|
|
+
|
|
|
|
+ this.legendListView = (ListView) rootView.findViewById(R.id.legend_list_view);
|
|
|
|
+ this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
|
|
+ StatisticsFragment.this.userTappedOnLegendItem(i);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.rootView = rootView;
|
|
|
|
+ rootView.setWillNotDraw(false);
|
|
|
|
+
|
|
|
|
+ this.configureRootView(rootView);
|
|
|
|
+ }
|
|
|
|
|
|
private Context getBaseContext(){
|
|
private Context getBaseContext(){
|
|
return this.getActivity().getBaseContext();
|
|
return this.getActivity().getBaseContext();
|
|
@@ -443,12 +470,18 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
ArrayList<String> titles =dialog.getSelectedItemTitles();
|
|
ArrayList<String> titles =dialog.getSelectedItemTitles();
|
|
|
|
|
|
if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
- this.filter.setProtocols(titles.size() == 0 ? this.protocolTitles() : titles);
|
|
|
|
|
|
+ //titles = titles.size() == 0 ? this.protocolTitles() : titles;
|
|
|
|
+ this.filter.setProtocols(titles);
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (title.equals(FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE)){
|
|
if (title.equals(FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE)){
|
|
|
|
+ if (titles.size() == 0){
|
|
|
|
+ titles = new ArrayList<String>();
|
|
|
|
+ titles.add(this.protocolTitles().get(0));
|
|
|
|
+ }
|
|
this.filter.setProtocols(titles);
|
|
this.filter.setProtocols(titles);
|
|
|
|
+
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
String fragTitle = "" + this.getCurrentSelectedProtocol() + ": " + this.selectedCompareData;
|
|
String fragTitle = "" + this.getCurrentSelectedProtocol() + ": " + this.selectedCompareData;
|
|
this.setTitle(fragTitle);
|
|
this.setTitle(fragTitle);
|
|
@@ -599,7 +632,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
titles.add(FILTER_MENU_TITLE_ESSID);
|
|
titles.add(FILTER_MENU_TITLE_ESSID);
|
|
titles.add(FILTER_MENU_TITLE_PROTOCOLS);
|
|
titles.add(FILTER_MENU_TITLE_PROTOCOLS);
|
|
titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
|
|
titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
|
|
- if (this.filter.hasESSIDs() || this.filter.hasATimestamp()){
|
|
|
|
|
|
+ if (this.filter.hasESSIDs() || this.filter.hasATimestamp() || (this.filter.getProtocols() != null && this.filter.hasProtocols() && this.filter.getProtocols().size() != this.protocolTitles().size())){
|
|
titles.add(FILTER_MENU_TITLE_REMOVE);
|
|
titles.add(FILTER_MENU_TITLE_REMOVE);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -755,6 +788,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.lineGraph = new LineGraph(this.getActivity());
|
|
this.lineGraph = new LineGraph(this.getActivity());
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
plotLayout.addView(this.lineGraph);
|
|
plotLayout.addView(this.lineGraph);
|
|
|
|
+ this.lineGraph.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT ));
|
|
}
|
|
}
|
|
return this.lineGraph;
|
|
return this.lineGraph;
|
|
}
|
|
}
|
|
@@ -883,7 +917,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
int maxY = (int)(rangeMax_Y - rangeMin_Y);
|
|
int maxY = (int)(rangeMax_Y - rangeMin_Y);
|
|
this.lineGraph.setYAxisStep(Math.min(maxY, 5));
|
|
this.lineGraph.setYAxisStep(Math.min(maxY, 5));
|
|
int yStep = (int)this.lineGraph.getyAxisStep();
|
|
int yStep = (int)this.lineGraph.getyAxisStep();
|
|
- maxY = maxY + (maxY % yStep);
|
|
|
|
|
|
+ if ((maxY % yStep) != 0) {
|
|
|
|
+ maxY = maxY + (yStep - (maxY % yStep));
|
|
|
|
+ }
|
|
this.lineGraph.setRangeY(rangeMin_Y, rangeMin_Y + maxY);
|
|
this.lineGraph.setRangeY(rangeMin_Y, rangeMin_Y + maxY);
|
|
this.lineGraph.setLineToFill(0);
|
|
this.lineGraph.setLineToFill(0);
|
|
this.lineGraph.invalidate();
|
|
this.lineGraph.invalidate();
|
|
@@ -1292,7 +1328,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
return this.filter.hasESSIDs();
|
|
return this.filter.hasESSIDs();
|
|
}
|
|
}
|
|
if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
- return this.filter.hasProtocols();
|
|
|
|
|
|
+ return (this.filter.getProtocols() != null && this.filter.hasProtocols() && this.filter.getProtocols().size() != this.protocolTitles().size());
|
|
}
|
|
}
|
|
if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)){
|
|
if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)){
|
|
return this.filter.hasBelowTimestamp();
|
|
return this.filter.hasBelowTimestamp();
|