|
@@ -5,6 +5,9 @@ import android.app.Activity;
|
|
|
import android.app.FragmentManager;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.graphics.PorterDuff;
|
|
|
+import android.graphics.drawable.Drawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
@@ -66,6 +69,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
|
|
|
private LogFilter filter;
|
|
|
private boolean showFilterButton;
|
|
|
+ private View rootView;
|
|
|
|
|
|
private int mListPosition = -1;
|
|
|
private int mItemPosition = -1;
|
|
@@ -129,6 +133,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
this.setShowFilterButton(!this.filter.isNotEditable());
|
|
|
|
|
|
View rootView = inflater.inflate(this.getLayoutId(), container, false);
|
|
|
+ this.rootView = rootView;
|
|
|
ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
|
|
|
|
|
|
this.spinner =(ProgressBar) rootView.findViewById(R.id.progressBar1);
|
|
@@ -432,6 +437,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
loader = null;
|
|
|
|
|
|
this.spinner.setVisibility(View.VISIBLE);
|
|
|
+ this.actualiseFilterButton();
|
|
|
|
|
|
loader = new Thread(new Runnable() {
|
|
|
@Override
|
|
@@ -669,6 +675,12 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
*
|
|
|
* ***************************/
|
|
|
|
|
|
+ /**Returns the FilterButton.
|
|
|
+ * @return ImageButton filterButton*/
|
|
|
+ private ImageButton getFilterButton(){
|
|
|
+ return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
|
|
|
+ }
|
|
|
+
|
|
|
/**Opens the filter menu on a anchor view. The filter menu will always be on top of the anchor.
|
|
|
* @param View anchorView*/
|
|
|
private void openFilterPopupMenuOnView(View v){
|
|
@@ -910,7 +922,8 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
this.filter.setAboveTimestamp(dialog.getDate());
|
|
|
}
|
|
|
this.actualiseListViewInBackground();
|
|
|
- }
|
|
|
+ this.actualiseFilterButton();
|
|
|
+ }
|
|
|
/**
|
|
|
* Will be called if the users cancels a timestamp selection.
|
|
|
* @param DateTimeDialogFragment dialog
|
|
@@ -921,7 +934,8 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
} else {
|
|
|
this.filter.setAboveTimestamp(Long.MIN_VALUE);
|
|
|
}
|
|
|
- }
|
|
|
+ this.actualiseFilterButton();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Will be called if the users clicks the positiv button on a ChechlistDialog.
|
|
@@ -966,8 +980,27 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
this.groupingKey = titles.get(0);
|
|
|
}
|
|
|
this.actualiseListViewInBackground();
|
|
|
+
|
|
|
+ this.actualiseFilterButton();
|
|
|
}
|
|
|
|
|
|
+ /**Paints the filter button if the current filter object is set.*/
|
|
|
+ private void actualiseFilterButton(){
|
|
|
+ if (this.filter.isSet() ){
|
|
|
+ ImageButton filterButton = this.getFilterButton();
|
|
|
+ if (filterButton != null){
|
|
|
+ filterButton.setImageResource(R.drawable.ic_filter_pressed);
|
|
|
+ filterButton.invalidate();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ImageButton filterButton = this.getFilterButton();
|
|
|
+ if (filterButton != null){
|
|
|
+ filterButton.setImageResource(R.drawable.ic_filter);
|
|
|
+ filterButton.invalidate();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Will be called if the users clicks the negativ button on a ChechlistDialog.
|
|
|
* @param ChecklistDialog dialog
|