package org.azavea.otm.filters;

import org.azavea.otm.R;

import android.view.View;
import android.widget.ToggleButton;

public class BooleanFilter extends MapFilter {
	public boolean active;
	

	public BooleanFilter(String key, String label) {
		initialize(key, label, false);
	}
	
	public BooleanFilter(String key, String label, boolean active) {
		initialize(key, label, active);
	}
	
	private void initialize(String key, String label, boolean active) {
		this.key = key;
		this.active = active;
		this.label = label;
	}
	
	@Override
	public String toQueryStringParam() {
		return key + "=" + Boolean.toString(active);
	}

	@Override
	public void updateFromView(View view) {
		this.active = ((ToggleButton)view.findViewById(R.id.active)).isChecked();
	}

	@Override
	public boolean isActive() {
		return this.active;
	}
}

@@ -154,11 +154,12 @@
 nds 
-Map
+Base
 Filt
@@ -817,11 +817,67 @@
 tive;%0A%09%7D
+%0A%0A%09@Override%0A%09public void clear() %7B%0A%09%09active = false;%0A%09%7D
 %0A%7D%0A

Update base filter name and implment overrides