Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-student-hostagev2

Fabio Arnold 10 years ago
parent
commit
c615a212c6

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java

@@ -104,7 +104,7 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
                     public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                         ServicesListItem item = (ServicesListItem) buttonView.getTag();
                         mProfile = ProfileManager.getInstance().getCurrentActivatedProfile();
-                        if (!HelperUtils.isWifiConnected(mActivity)) {
+                        if (!HelperUtils.isNetworkAvailable(mActivity)) {
                             new AlertDialog.Builder(mActivity)
                                     .setTitle(R.string.information)
                                     .setMessage(R.string.wifi_not_connected_msg)

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ServicesFragment.java

@@ -173,7 +173,7 @@ public class ServicesFragment extends Fragment {
             switchChangeListener = new CompoundButton.OnCheckedChangeListener() {
                 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                     mProfile = ProfileManager.getInstance().getCurrentActivatedProfile();
-                    if (!HelperUtils.isWifiConnected(getActivity())) {
+                    if (!HelperUtils.isNetworkAvailable(getActivity())) {
                         new AlertDialog.Builder(getActivity())
                                 .setTitle(R.string.information)
                                 .setMessage(R.string.wifi_not_connected_msg)

+ 17 - 7
src/de/tudarmstadt/informatik/hostage/ui2/fragment/StatisticsFragment.java

@@ -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 {