// Path: app/src/main/java/com/habitissimo/vespapp/Vespapp.java
// public class Vespapp extends Application {
//     private static final boolean FORCE_MOCK = false;
//     private Database database;
//     private VespappApi api;
//     private Gson gson;
//     private OkHttpClient httpClient;
// 
//     public static Vespapp get(Context context) {
//         return (Vespapp) context.getApplicationContext();
//     }
// 
//     private void setStrictModeConfigurationWorkaround() {
//         //Workaround for modifying StrictMode parameters.
//         //See http://code.google.com/p/android/issues/detail?id=35298
//         new Handler().postAtFrontOfQueue(new Runnable() {
//             @Override public void run() {
//                 setStrictModeConfiguration();
//             }
//         });
//     }
// 
//     private void setStrictModeConfiguration() {
//         StrictMode.ThreadPolicy policy;
//         policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
//         StrictMode.setThreadPolicy(policy);
//     }
// 
//     @Override public void onCreate() {
//         setStrictModeConfiguration();
//         super.onCreate();
//         setStrictModeConfigurationWorkaround();
// 
//         Iconify.with(new FontAwesomeModule());
// 
//         gson = new Gson();
//         database = new Database(this, gson);
//         httpClient = new OkHttpClient.Builder()
//                 .build();
//         Picasso.setSingletonInstance(new Picasso.Builder(this)
//                 .listener(new Listener() {
//                     @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
//                         Log.d("Picasso", "Image failed loading: " + exception);
//                     }
//                 })
//                 .build());
// 
//         if (Constants.isBaseApiUrlDefined() && !FORCE_MOCK) {
//             Retrofit retrofit = new Builder()
//                     .baseUrl(Constants.API_BASE_URL)
//                     .addConverterFactory(GsonConverterFactory.create(gson))
//                     .client(httpClient)
//                     .build();
//             api = retrofit.create(VespappApi.class);
//         }
//     }
// 
//     public Database getDatabase() {
//         return database;
//     }
// 
//     public VespappApi getApi() {
//         if (api == null)
//             throw new RuntimeException("Constants.API_BASE_URL is not defined");
// 
//         return api;
//     }
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/api/VespappApi.java
// public interface VespappApi {
// 
//     @GET("sightings/{sightingId}/questions/")
//     Call<List<Question>> getQuestions(@Path("sightingId") String sightingId);
// 
//     @GET("sightings/{sightingId}/photos/")
//     Call <List<Picture>> getPhotos(@Path("sightingId") String sightingId);
// 
//     @GET("locations/")
//     Call<List<Location>> getLocations();
// 
//     @GET("sightings/")
//     Call<List<Sighting>> getSightings();
// 
//     @GET("info/")
//     Call<List<Info>> getInfo();
// 
//     @POST("sightings/")
//     Call<Sighting> createSighting(@Body Sighting sighting);
// 
//     @PUT("sightings/{sightingId}/")
//     Call<Sighting> updateSighting(@Body Sighting sighting, @Path("sightingId") String sightingId);
// 
//     /**
//      * @see VespappApiHelper#buildPhotoApiParameter(File)
//      */
//     @Multipart
//     @POST("sightings/{sightingId}/photos/")
//     Call<Void> addPhoto(@Path("sightingId") String sightingId, @Part("file\"; filename=\"photo.png\" ") RequestBody photo);
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/async/Task.java
// public class Task {
//     public static <T> void doInBackground(final TaskCallback<T> taskCallback) {
//         new AsyncTask<Void, Void, T>() {
//             @Override protected T doInBackground(Void... params) {
//                 try {
//                     return taskCallback.executeInBackground();
//                 } catch (Throwable t) {
//                     taskCallback.onError(t);
//                     return null;
//                 }
//             }
// 
//             @Override protected void onPostExecute(T t) {
//                 if (t != null) {
//                     taskCallback.onCompleted(t);
//                 }
//             }
//         }.execute((Void) null);
//     }
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/async/TaskCallback.java
// public interface TaskCallback<T> {
//     T executeInBackground();
// 
//     void onError(Throwable t);
// 
//     void onCompleted(T t);
// }


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.habitissimo.vespapp.R;
import com.habitissimo.vespapp.Vespapp;
import com.habitissimo.vespapp.api.VespappApi;
import com.habitissimo.vespapp.async.Task;
import com.habitissimo.vespapp.async.TaskCallback;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
package com.habitissimo.vespapp.sighting;





public class NewSightingLocationsActivity extends AppCompatActivity {

    private Sighting sighting;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_sighting_locations);

        initToolbar();

        Intent i = getIntent();
        sighting = (Sighting) i.getSerializableExtra("sightingObject");

        initList();
    }

    private void initToolbar() {
        // Set a toolbar to replace the action bar.
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_locations_list);
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle(R.string.confirm_cap_location);
    }

    private void initList(){
// Path: app/src/main/java/com/habitissimo/vespapp/Vespapp.java
// public class Vespapp extends Application {
//     private static final boolean FORCE_MOCK = false;
//     private Database database;
//     private VespappApi api;
//     private Gson gson;
//     private OkHttpClient httpClient;
// 
//     public static Vespapp get(Context context) {
//         return (Vespapp) context.getApplicationContext();
//     }
// 
//     private void setStrictModeConfigurationWorkaround() {
//         //Workaround for modifying StrictMode parameters.
//         //See http://code.google.com/p/android/issues/detail?id=35298
//         new Handler().postAtFrontOfQueue(new Runnable() {
//             @Override public void run() {
//                 setStrictModeConfiguration();
//             }
//         });
//     }
// 
//     private void setStrictModeConfiguration() {
//         StrictMode.ThreadPolicy policy;
//         policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
//         StrictMode.setThreadPolicy(policy);
//     }
// 
//     @Override public void onCreate() {
//         setStrictModeConfiguration();
//         super.onCreate();
//         setStrictModeConfigurationWorkaround();
// 
//         Iconify.with(new FontAwesomeModule());
// 
//         gson = new Gson();
//         database = new Database(this, gson);
//         httpClient = new OkHttpClient.Builder()
//                 .build();
//         Picasso.setSingletonInstance(new Picasso.Builder(this)
//                 .listener(new Listener() {
//                     @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
//                         Log.d("Picasso", "Image failed loading: " + exception);
//                     }
//                 })
//                 .build());
// 
//         if (Constants.isBaseApiUrlDefined() && !FORCE_MOCK) {
//             Retrofit retrofit = new Builder()
//                     .baseUrl(Constants.API_BASE_URL)
//                     .addConverterFactory(GsonConverterFactory.create(gson))
//                     .client(httpClient)
//                     .build();
//             api = retrofit.create(VespappApi.class);
//         }
//     }
// 
//     public Database getDatabase() {
//         return database;
//     }
// 
//     public VespappApi getApi() {
//         if (api == null)
//             throw new RuntimeException("Constants.API_BASE_URL is not defined");
// 
//         return api;
//     }
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/api/VespappApi.java
// public interface VespappApi {
// 
//     @GET("sightings/{sightingId}/questions/")
//     Call<List<Question>> getQuestions(@Path("sightingId") String sightingId);
// 
//     @GET("sightings/{sightingId}/photos/")
//     Call <List<Picture>> getPhotos(@Path("sightingId") String sightingId);
// 
//     @GET("locations/")
//     Call<List<Location>> getLocations();
// 
//     @GET("sightings/")
//     Call<List<Sighting>> getSightings();
// 
//     @GET("info/")
//     Call<List<Info>> getInfo();
// 
//     @POST("sightings/")
//     Call<Sighting> createSighting(@Body Sighting sighting);
// 
//     @PUT("sightings/{sightingId}/")
//     Call<Sighting> updateSighting(@Body Sighting sighting, @Path("sightingId") String sightingId);
// 
//     /**
//      * @see VespappApiHelper#buildPhotoApiParameter(File)
//      */
//     @Multipart
//     @POST("sightings/{sightingId}/photos/")
//     Call<Void> addPhoto(@Path("sightingId") String sightingId, @Part("file\"; filename=\"photo.png\" ") RequestBody photo);
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/async/Task.java
// public class Task {
//     public static <T> void doInBackground(final TaskCallback<T> taskCallback) {
//         new AsyncTask<Void, Void, T>() {
//             @Override protected T doInBackground(Void... params) {
//                 try {
//                     return taskCallback.executeInBackground();
//                 } catch (Throwable t) {
//                     taskCallback.onError(t);
//                     return null;
//                 }
//             }
// 
//             @Override protected void onPostExecute(T t) {
//                 if (t != null) {
//                     taskCallback.onCompleted(t);
//                 }
//             }
//         }.execute((Void) null);
//     }
// }
// 
// Path: app/src/main/java/com/habitissimo/vespapp/async/TaskCallback.java
// public interface TaskCallback<T> {
//     T executeInBackground();
// 
//     void onError(Throwable t);
// 
//     void onCompleted(T t);
// }


// Path: app/src/main/java/com/habitissimo/vespapp/sighting/NewSightingLocationsActivity.java
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.habitissimo.vespapp.R;
import com.habitissimo.vespapp.Vespapp;
import com.habitissimo.vespapp.api.VespappApi;
import com.habitissimo.vespapp.async.Task;
import com.habitissimo.vespapp.async.TaskCallback;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

package com.habitissimo.vespapp.sighting;





public class NewSightingLocationsActivity extends AppCompatActivity {

    private Sighting sighting;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_sighting_locations);

        initToolbar();

        Intent i = getIntent();
        sighting = (Sighting) i.getSerializableExtra("sightingObject");

        initList();
    }

    private void initToolbar() {
        // Set a toolbar to replace the action bar.
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_locations_list);
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle(R.string.confirm_cap_location);
    }

    private void initList(){
        final VespappApi api = Vespapp.get(this).getApi();