Android Open Source - image-rover Filter Settings

From Project

Back to project page image-rover.


The source code is released under:

MIT License

If you think the Android project image-rover listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.codepath.wangela.apps.image;
//w w  w.  ja v a  2  s .  c o  m

import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;


public class FilterSettings extends Activity implements Serializable {
  private String size = "";
  private String type = "";
  private String site = "";
  FilterSettings filters;
  RadioGroup rgSize;
  RadioGroup rgType;
  EditText etSite;
  int rbSizeSelected;
  int rbTypeSelected;
  //String sizeFilter;
  //String typeFilter;
  protected void onCreate(Bundle savedInstanceState) {
    rgSize = (RadioGroup) findViewById(;
    rgType = (RadioGroup) findViewById(;
    etSite = (EditText) findViewById(;
    filters = (FilterSettings) getIntent().getSerializableExtra("filters");
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      // Respond to the action bar's Up/Home button
          return true;
      return super.onOptionsItemSelected(item);
//  public RequestParams toParams() {
    // formatting the URL based on filters like ?type=faces&color=blue 
  //  RequestParams params = new RequestParams();
    //params.put("imgcolor", rbImgColor);
  //  params.put("size", sizeFilter);
  //  params.put("type", typeFilter);
    //params.put("as_rights", rbAsRights);
  //  return params;
//  }

  public String getFilterSize() {
    return size;
  public String getFilterType() {
    return type;
  public String getFilterSite() {
    return site;
  public void onSubmit(View v) {
    // Pass filter settings back to Search (parent) activity
    rbSizeSelected = rgSize.getCheckedRadioButtonId();
    RadioButton rbSize = (RadioButton) findViewById(rbSizeSelected);
    size = rbSize.getTag().toString();
    rbTypeSelected = rgType.getCheckedRadioButtonId();
    RadioButton rbType = (RadioButton) findViewById(rbTypeSelected);
    type = rbType.getTag().toString();
    site = etSite.getText().toString();
    filters.size = size;
    filters.type = type; = site;
    Intent i = new Intent();
    i.putExtra("filters", filters);
    setResult(RESULT_OK, i);

Java Source Code List