// Path: src/main/java/de/fahrgemeinschaft/ContactProvider.java
// public static final class CONTACT {
//     public static final String USER = "user";
//     public static final String EMAIL = "Email";
//     public static final String PLATE = "NumberPlate";
//     public static final String MOBILE = "Mobile";
//     public static final String LANDLINE = "Landline";
// }
// 
// Path: src/main/java/de/fahrgemeinschaft/util/PlaceImageButton.java
// public class PlaceImageButton extends BaseImageButton {
// 
//     private TextView address;
//     public Button name;
// 
//     @Override
//     protected int inflate() {
//         return R.layout.btn_place_picker;
//     }
// 
//     public PlaceImageButton(Context context) {
//         super(context);
//         name = (Button) findViewById(R.id.name);
//         name.setId(ID--);
//         address = (TextView) findViewById(R.id.address);
//         address.setId(ID--);
//     }
// 
//     public PlaceImageButton(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         name = (Button) findViewById(R.id.name);
//         name.setId(ID--);
//         name.setText(getContext().getString(attrs.getAttributeResourceValue(
//                 droid, TEXT, R.string.app_name)));
//         address = (TextView) findViewById(R.id.address);
//         address.setId(ID--);
//     }
// 
//     public void setPlace(Place place) {
//         if (place != null) {
//             name.setText(place.getName());
//             address.setText(place.getAddress());
//         }
//     }
// }


import java.util.List;
import org.teleportr.Place;
import org.teleportr.Ride;
import org.teleportr.Ride.Mode;
import org.teleportr.RidesProvider;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import de.fahrgemeinschaft.ContactProvider.CONTACT;
import de.fahrgemeinschaft.util.PlaceImageButton;
        route = (LinearLayout) v.findViewById(R.id.route);
        from = (PlaceImageButton) v.findViewById(R.id.from);
        from.name.setOnClickListener(autocompletePlace);
        from.icon.setOnClickListener(pickPlace);
        to = (PlaceImageButton) v.findViewById(R.id.to);
        to.icon.setOnClickListener(pickDestinationPlace);
        to.name.setOnClickListener(autocompleteDestinationPlace);
    }

    public void setRide(Ride ride) {
        this.ride = ride;
        if (ride.getFrom() != null)
            from.setPlace(ride.getFrom());
        if (ride.getTo() != null)
            to.setPlace(ride.getTo());
        setVias(ride.getVias());
        setMode(ride.getMode());
        setSeats(ride.getSeats());
    }

    private void setMode(Mode mode) {
        ride.mode(mode);
        switch(mode) {
        case CAR:
            getActivity().findViewById(R.id.mode_car).setSelected(true);
            getActivity().findViewById(R.id.mode_rail).setSelected(false);
            ((TextView) getActivity().findViewById(R.id.mode_car_text))
                .setTextColor(getResources().getColor(R.color.dark_green));
            ((TextView) getActivity().findViewById(R.id.mode_rail_text))
                .setTextColor(getResources().getColor(R.color.white));
// Path: src/main/java/de/fahrgemeinschaft/ContactProvider.java
// public static final class CONTACT {
//     public static final String USER = "user";
//     public static final String EMAIL = "Email";
//     public static final String PLATE = "NumberPlate";
//     public static final String MOBILE = "Mobile";
//     public static final String LANDLINE = "Landline";
// }
// 
// Path: src/main/java/de/fahrgemeinschaft/util/PlaceImageButton.java
// public class PlaceImageButton extends BaseImageButton {
// 
//     private TextView address;
//     public Button name;
// 
//     @Override
//     protected int inflate() {
//         return R.layout.btn_place_picker;
//     }
// 
//     public PlaceImageButton(Context context) {
//         super(context);
//         name = (Button) findViewById(R.id.name);
//         name.setId(ID--);
//         address = (TextView) findViewById(R.id.address);
//         address.setId(ID--);
//     }
// 
//     public PlaceImageButton(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         name = (Button) findViewById(R.id.name);
//         name.setId(ID--);
//         name.setText(getContext().getString(attrs.getAttributeResourceValue(
//                 droid, TEXT, R.string.app_name)));
//         address = (TextView) findViewById(R.id.address);
//         address.setId(ID--);
//     }
// 
//     public void setPlace(Place place) {
//         if (place != null) {
//             name.setText(place.getName());
//             address.setText(place.getAddress());
//         }
//     }
// }


// Path: src/main/java/de/fahrgemeinschaft/EditRideFragment1.java
import java.util.List;
import org.teleportr.Place;
import org.teleportr.Ride;
import org.teleportr.Ride.Mode;
import org.teleportr.RidesProvider;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import de.fahrgemeinschaft.ContactProvider.CONTACT;
import de.fahrgemeinschaft.util.PlaceImageButton;

        route = (LinearLayout) v.findViewById(R.id.route);
        from = (PlaceImageButton) v.findViewById(R.id.from);
        from.name.setOnClickListener(autocompletePlace);
        from.icon.setOnClickListener(pickPlace);
        to = (PlaceImageButton) v.findViewById(R.id.to);
        to.icon.setOnClickListener(pickDestinationPlace);
        to.name.setOnClickListener(autocompleteDestinationPlace);
    }

    public void setRide(Ride ride) {
        this.ride = ride;
        if (ride.getFrom() != null)
            from.setPlace(ride.getFrom());
        if (ride.getTo() != null)
            to.setPlace(ride.getTo());
        setVias(ride.getVias());
        setMode(ride.getMode());
        setSeats(ride.getSeats());
    }

    private void setMode(Mode mode) {
        ride.mode(mode);
        switch(mode) {
        case CAR:
            getActivity().findViewById(R.id.mode_car).setSelected(true);
            getActivity().findViewById(R.id.mode_rail).setSelected(false);
            ((TextView) getActivity().findViewById(R.id.mode_car_text))
                .setTextColor(getResources().getColor(R.color.dark_green));
            ((TextView) getActivity().findViewById(R.id.mode_rail_text))
                .setTextColor(getResources().getColor(R.color.white));
            ride.set(CONTACT.PLATE, "");