|
@@ -17,6 +17,7 @@ import android.widget.ImageButton;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.ProgressBar;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.echo.holographlibrary.Bar;
|
|
@@ -211,6 +212,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
container.addView(this.rootView);
|
|
|
|
|
|
this.configureRootView(this.rootView);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private Context getBaseContext(){
|
|
@@ -223,13 +225,21 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
|
|
|
public void configureRootView(View rootView){
|
|
|
LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
|
|
|
- plotLayout.setWillNotDraw(false);
|
|
|
plotLayout.removeAllViews();
|
|
|
-
|
|
|
plotLayout.setWillNotDraw(false);
|
|
|
|
|
|
- this.spinner = (ProgressBar) rootView.findViewById(R.id.progressBar1);
|
|
|
- this.spinner.setVisibility(View.GONE);
|
|
|
+ ProgressBar spinner = (ProgressBar) rootView.findViewById(R.id.progressBar1);
|
|
|
+ if(spinner != null){
|
|
|
+ this.spinner = spinner;
|
|
|
+ this.spinner.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ RelativeLayout parent = (RelativeLayout) this.spinner.getParent();
|
|
|
+ parent.removeView(this.spinner);
|
|
|
+ RelativeLayout newParent = (RelativeLayout) rootView.findViewById(R.id.plot_parent_layout);
|
|
|
+ if (newParent != null){
|
|
|
+ newParent.addView(this.spinner);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.legendListView = (ListView) rootView.findViewById(R.id.legend_list_view);
|
|
|
this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
@@ -240,8 +250,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
});
|
|
|
rootView.setWillNotDraw(false);
|
|
|
|
|
|
- this.actualiseCurrentPlot();
|
|
|
-
|
|
|
ImageButton visualButton = (ImageButton) rootView.findViewById(R.id.plot_data_button);
|
|
|
visualButton.setOnClickListener(new View.OnClickListener() {
|
|
|
public void onClick(View v) {
|
|
@@ -257,6 +265,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.actualiseCurrentPlot();
|
|
|
+
|
|
|
if (this.currentPlotView instanceof BarGraph){
|
|
|
this.setTitle("" + this.getCurrentSelectedProtocol() + ": " +this.selectedCompareData);
|
|
|
} else {
|
|
@@ -1474,7 +1484,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
return "" + hour + ":00";
|
|
|
}
|
|
|
|
|
|
- static final DateFormat dateFormat = new SimpleDateFormat("d.M.yyyy");
|
|
|
+ static final DateFormat dateFormat = new SimpleDateFormat("d.M.yy");
|
|
|
@SuppressLint("SimpleDateFormat")
|
|
|
private String getDateAsDayString(long timeStamp) {
|
|
|
try {
|