// Path: api/src/main/java/ch/liip/timeforcoffee/api/models/Station.java
// public class Station {
// 
//     private final int id;
//     private final String name;
//     private final Location location;
//     private final float distance;
//     private boolean isFavorite;
// 
//     public Station(int id, String name, float distance, Location location, boolean isFavorite) {
//         this.id = id;
//         this.name = name;
//         this.location = location;
//         this.distance = distance;
//         this.isFavorite = isFavorite;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Location getLocation() {
//         return location;
//     }
// 
//     public float getDistance() {
//         return distance;
//     }
// 
//     public boolean getIsFavorite() {
//         return isFavorite;
//     }
// 
//     public void setIsFavorite(boolean isFavorite) {
//         this.isFavorite = isFavorite;
//     }
// 
//     public String getDistanceForDisplay(Location userLocation) {
// 
//         if (userLocation != null) {
//             int directDistance = getDistanceInMeter(userLocation);
// 
//             if (directDistance > 5000) {
//                 int km = (int) (Math.round((double) (directDistance) / 1000));
//                 return km + " km";
//             } else {
//                 return directDistance + " m";
//             }
//         }
//         return null;
//     }
// 
//     private int getDistanceInMeter(Location userLocation) {
//         if (userLocation != null) {
//             return (int) userLocation.distanceTo(location);
//         }
//         return 0;
//     }
// 
//     @Override
//     public boolean equals(Object object) {
//         boolean sameName = false;
// 
//         if (object instanceof Station) {
//             sameName = this.name.equals(((Station) object).getName());
//         }
// 
//         return sameName;
//     }
// }
// 
// Path: wear/src/main/java/ch/liip/timeforcoffee/view/StationItemView.java
// public final class StationItemView extends FrameLayout implements WearableListView.OnCenterProximityListener {
// 
//     final TextView mName;
//     final ImageView mImage;
// 
//     public StationItemView(Context context) {
//         super(context);
//         View.inflate(context, R.layout.station_item, this);
//         mName = (TextView) findViewById(R.id.name);
//         mImage = (ImageView) findViewById(R.id.place);
//     }
// 
//     @Override
//     public void onCenterPosition(boolean b) {
//         mImage.setAlpha(1f);
//         mImage.setAlpha(1f);
//     }
// 
//     @Override
//     public void onNonCenterPosition(boolean b) {
//         mImage.setAlpha(0.6f);
//         mImage.setAlpha(0.6f);
//     }
// }


import android.content.Context;
import android.support.wearable.view.WearableListView;
import android.view.ViewGroup;
import android.widget.TextView;
import ch.liip.timeforcoffee.R;
import ch.liip.timeforcoffee.api.models.Station;
import ch.liip.timeforcoffee.view.StationItemView;
import java.util.List;
package ch.liip.timeforcoffee.adapter;



/**
 * Created by fsantschi on 08/03/15.
 */
public class StationListAdapter extends WearableListView.Adapter {

    private List<Station> mStations;
    private Context mContext;

    public StationListAdapter(Context context, List<Station> stations) {
        mStations = stations;
        mContext = context;
    }

    @Override
    public WearableListView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
// Path: api/src/main/java/ch/liip/timeforcoffee/api/models/Station.java
// public class Station {
// 
//     private final int id;
//     private final String name;
//     private final Location location;
//     private final float distance;
//     private boolean isFavorite;
// 
//     public Station(int id, String name, float distance, Location location, boolean isFavorite) {
//         this.id = id;
//         this.name = name;
//         this.location = location;
//         this.distance = distance;
//         this.isFavorite = isFavorite;
//     }
// 
//     public int getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Location getLocation() {
//         return location;
//     }
// 
//     public float getDistance() {
//         return distance;
//     }
// 
//     public boolean getIsFavorite() {
//         return isFavorite;
//     }
// 
//     public void setIsFavorite(boolean isFavorite) {
//         this.isFavorite = isFavorite;
//     }
// 
//     public String getDistanceForDisplay(Location userLocation) {
// 
//         if (userLocation != null) {
//             int directDistance = getDistanceInMeter(userLocation);
// 
//             if (directDistance > 5000) {
//                 int km = (int) (Math.round((double) (directDistance) / 1000));
//                 return km + " km";
//             } else {
//                 return directDistance + " m";
//             }
//         }
//         return null;
//     }
// 
//     private int getDistanceInMeter(Location userLocation) {
//         if (userLocation != null) {
//             return (int) userLocation.distanceTo(location);
//         }
//         return 0;
//     }
// 
//     @Override
//     public boolean equals(Object object) {
//         boolean sameName = false;
// 
//         if (object instanceof Station) {
//             sameName = this.name.equals(((Station) object).getName());
//         }
// 
//         return sameName;
//     }
// }
// 
// Path: wear/src/main/java/ch/liip/timeforcoffee/view/StationItemView.java
// public final class StationItemView extends FrameLayout implements WearableListView.OnCenterProximityListener {
// 
//     final TextView mName;
//     final ImageView mImage;
// 
//     public StationItemView(Context context) {
//         super(context);
//         View.inflate(context, R.layout.station_item, this);
//         mName = (TextView) findViewById(R.id.name);
//         mImage = (ImageView) findViewById(R.id.place);
//     }
// 
//     @Override
//     public void onCenterPosition(boolean b) {
//         mImage.setAlpha(1f);
//         mImage.setAlpha(1f);
//     }
// 
//     @Override
//     public void onNonCenterPosition(boolean b) {
//         mImage.setAlpha(0.6f);
//         mImage.setAlpha(0.6f);
//     }
// }


// Path: wear/src/main/java/ch/liip/timeforcoffee/adapter/StationListAdapter.java
import android.content.Context;
import android.support.wearable.view.WearableListView;
import android.view.ViewGroup;
import android.widget.TextView;
import ch.liip.timeforcoffee.R;
import ch.liip.timeforcoffee.api.models.Station;
import ch.liip.timeforcoffee.view.StationItemView;
import java.util.List;

package ch.liip.timeforcoffee.adapter;



/**
 * Created by fsantschi on 08/03/15.
 */
public class StationListAdapter extends WearableListView.Adapter {

    private List<Station> mStations;
    private Context mContext;

    public StationListAdapter(Context context, List<Station> stations) {
        mStations = stations;
        mContext = context;
    }

    @Override
    public WearableListView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new WearableListView.ViewHolder(new StationItemView(mContext));