Browse Source

dismiss title if no data is available

Julien Clauter 10 years ago
parent
commit
a3c867d645

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

@@ -433,6 +433,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
                 tableHeaderTitleView.setText(FILTER_MENU_TITLE_ESSID);
             }
         }
+        if (this.currentData == null || this.currentData.isEmpty()){
+            tableHeaderTitleView.setText("");
+            tableHeaderValueView.setText("");
+        }
     }
 
     /*
@@ -1237,6 +1241,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
                              StatisticsFragment.this.spinner.setVisibility(View.GONE);
 
                              StatisticsFragment.this.showEmptyDataNotification();
+                             if (StatisticsFragment.this.currentData == null || StatisticsFragment.this.currentData.isEmpty()){
+                                 StatisticsFragment.this.setTitle("");
+                             }
                          }
                      });
                  }
@@ -1258,10 +1265,14 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         } else {
             this.noDataNotificationToast.setText(R.string.no_data_notification_no_filter);
         }
-        if (this.currentData == null || this.currentData.isEmpty())
+        if (this.currentData == null || this.currentData.isEmpty()){
             this.noDataNotificationToast.show();
+            this.setTitle("");
+            // TODO HIDE LEGEND LIST TITLE
+        }
     }
 
+
     /** Calculates and returns the data for the piegraph
      * @return ArrayList<PlotComparisonItem> data */
     public ArrayList<PlotComparisonItem> getPieData(){