示例#1
0
 public void onClick(View v) {
   try {
     route.name = name.getText().toString();
     // route.description = description.getText().toString();
     route.show = show.isChecked();
     route.lineColor = color.getColor();
     setResult(RESULT_OK);
     finish();
   } catch (Exception e) {
     Toast.makeText(getBaseContext(), "Error saving route", Toast.LENGTH_LONG).show();
   }
 }
示例#2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // FIXME Should have its own layout
    setContentView(R.layout.act_track_properties);

    int index = getIntent().getExtras().getInt("index");

    Androzic application = (Androzic) getApplication();
    route = application.getRoute(index);

    name = (TextView) findViewById(R.id.name_text);
    name.setText(route.name);
    /*
    description = (TextView) findViewById(R.id.description_text);
    description.setText(track.description);
    */
    show = (CheckBox) findViewById(R.id.show_check);
    show.setChecked(route.show);
    color = (ColorButton) findViewById(R.id.color_button);
    color.setColor(route.lineColor, getResources().getColor(R.color.routeline));

    ViewGroup width = (ViewGroup) findViewById(R.id.width_layout);
    width.setVisibility(View.GONE);

    Button save = (Button) findViewById(R.id.done_button);
    save.setOnClickListener(saveOnClickListener);

    Button cancel = (Button) findViewById(R.id.cancel_button);
    cancel.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            finish();
          }
        });
  }