// Path: app/src/main/java/io/github/krtkush/marsexplorer/RESTClients/DataModels/PhotosJsonDataModels/Photos.java
// @AutoValue
// public abstract class Photos {
// 
//     /**
//      *Details of the image taken by the rover
//      */
// 
//     @SerializedName("id")
//     public abstract Integer id();
// 
//     @SerializedName("sol")
//     public abstract Integer sol();
// 
//     @SerializedName("img_src")
//     public abstract String imgSource();
// 
//     @SerializedName("earth_date")
//     public abstract String earthDate();
// 
//     @SerializedName("rover")
//     public abstract Rover rover();
// 
//     @SerializedName("camera")
//     public abstract Camera camera();
// 
//     public static TypeAdapter<Photos> typeAdapter(Gson gson) {
//         return new AutoValue_Photos.GsonTypeAdapter(gson);
//     }
// }
// 
// Path: app/src/main/java/io/github/krtkush/marsexplorer/RoverExplorer/ExpandedPhoto/ExpandedPhotosConstants.java
// public class ExpandedPhotosConstants {
// 
//     // Constants for identifying data being passed via intents
//     public static final String imageUrl = "ImageUrl";
// }
// 
// Path: app/src/main/java/io/github/krtkush/marsexplorer/RoverExplorer/ExpandedPhoto/PhotoExpandedViewActivity.java
// public class PhotoExpandedViewActivity extends AppCompatActivity {
// 
//     @BindView(R.id.expandedPhotoHolder) ImageView expandedPhotoHolder;
// 
//     private PhotoExpandedViewInteractor presenterInteractor;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_expanded_view);
// 
//         // Initialise butterknife, timber and the presenter layer
//         ButterKnife.bind(PhotoExpandedViewActivity.this);
//         Timber.tag(PhotoExpandedViewActivity.this.getClass().getSimpleName());
//         presenterInteractor = new PhotoExpandedViewPresenterLayer(this);
// 
//         // Fetch the url of the image to be displayed and then show that image.
//         presenterInteractor.getImageUrl();
//     }
// 
//     /**
//      * Set the images.
//      * @param imagePath
//      */
//     protected void setImage(String imagePath) {
// 
//         ActivityCompat.postponeEnterTransition(this);
//         Picasso.with(this.getApplicationContext())
//                 .load(imagePath)
//                 .fit()
//                 .centerCrop()
//                 .placeholder(R.drawable.square_placeholder)
//                 .into(expandedPhotoHolder, new Callback() {
//                     @Override
//                     public void onSuccess() {
//                         ActivityCompat
//                                 .startPostponedEnterTransition(PhotoExpandedViewActivity.this);
//                     }
// 
//                     @Override
//                     public void onError() {
//                         ActivityCompat
//                                 .startPostponedEnterTransition(PhotoExpandedViewActivity.this);
//                     }
//                 });
//     }
// }


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.krtkush.marsexplorer.R;
import io.github.krtkush.marsexplorer.RESTClients.DataModels.PhotosJsonDataModels.Photos;
import io.github.krtkush.marsexplorer.RoverExplorer.ExpandedPhoto.ExpandedPhotosConstants;
import io.github.krtkush.marsexplorer.RoverExplorer.ExpandedPhoto.PhotoExpandedViewActivity;
                .fit()
                .centerCrop()
                .into(photosViewHolder.photoHolder, new Callback() {
                    @Override
                    public void onSuccess() {
                        photosViewHolder.photoHolder.setTag(R.integer.hasImageLoaded,
                                activity.getString(R.string.imageHasLoaded));
                    }

                    @Override
                    public void onError() {
                        photosViewHolder.photoHolder.setTag(R.integer.hasImageLoaded, null);
                    }
                });

        // Photo Id
        photosViewHolder.photoId
                .setText(String.valueOf(photos.get(viewHolder.getAdapterPosition()).id()));

        // Camera Initials
        photosViewHolder.cameraInitial
                .setText(photos.get(viewHolder.getAdapterPosition()).camera().name());

        // On click action
        photosViewHolder.photoHolderLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent goToPhotoExpandedActivity =
                        new Intent(context, PhotoExpandedViewActivity.class);
// Path: app/src/main/java/io/github/krtkush/marsexplorer/RESTClients/DataModels/PhotosJsonDataModels/Photos.java
// @AutoValue
// public abstract class Photos {
// 
//     /**
//      *Details of the image taken by the rover
//      */
// 
//     @SerializedName("id")
//     public abstract Integer id();
// 
//     @SerializedName("sol")
//     public abstract Integer sol();
// 
//     @SerializedName("img_src")
//     public abstract String imgSource();
// 
//     @SerializedName("earth_date")
//     public abstract String earthDate();
// 
//     @SerializedName("rover")
//     public abstract Rover rover();
// 
//     @SerializedName("camera")
//     public abstract Camera camera();
// 
//     public static TypeAdapter<Photos> typeAdapter(Gson gson) {
//         return new AutoValue_Photos.GsonTypeAdapter(gson);
//     }
// }
// 
// Path: app/src/main/java/io/github/krtkush/marsexplorer/RoverExplorer/ExpandedPhoto/ExpandedPhotosConstants.java
// public class ExpandedPhotosConstants {
// 
//     // Constants for identifying data being passed via intents
//     public static final String imageUrl = "ImageUrl";
// }
// 
// Path: app/src/main/java/io/github/krtkush/marsexplorer/RoverExplorer/ExpandedPhoto/PhotoExpandedViewActivity.java
// public class PhotoExpandedViewActivity extends AppCompatActivity {
// 
//     @BindView(R.id.expandedPhotoHolder) ImageView expandedPhotoHolder;
// 
//     private PhotoExpandedViewInteractor presenterInteractor;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_expanded_view);
// 
//         // Initialise butterknife, timber and the presenter layer
//         ButterKnife.bind(PhotoExpandedViewActivity.this);
//         Timber.tag(PhotoExpandedViewActivity.this.getClass().getSimpleName());
//         presenterInteractor = new PhotoExpandedViewPresenterLayer(this);
// 
//         // Fetch the url of the image to be displayed and then show that image.
//         presenterInteractor.getImageUrl();
//     }
// 
//     /**
//      * Set the images.
//      * @param imagePath
//      */
//     protected void setImage(String imagePath) {
// 
//         ActivityCompat.postponeEnterTransition(this);
//         Picasso.with(this.getApplicationContext())
//                 .load(imagePath)
//                 .fit()
//                 .centerCrop()
//                 .placeholder(R.drawable.square_placeholder)
//                 .into(expandedPhotoHolder, new Callback() {
//                     @Override
//                     public void onSuccess() {
//                         ActivityCompat
//                                 .startPostponedEnterTransition(PhotoExpandedViewActivity.this);
//                     }
// 
//                     @Override
//                     public void onError() {
//                         ActivityCompat
//                                 .startPostponedEnterTransition(PhotoExpandedViewActivity.this);
//                     }
//                 });
//     }
// }


// Path: app/src/main/java/io/github/krtkush/marsexplorer/RoverExplorer/ExplorerFragment/PhotosRecyclerViewAdapter.java
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.krtkush.marsexplorer.R;
import io.github.krtkush.marsexplorer.RESTClients.DataModels.PhotosJsonDataModels.Photos;
import io.github.krtkush.marsexplorer.RoverExplorer.ExpandedPhoto.ExpandedPhotosConstants;
import io.github.krtkush.marsexplorer.RoverExplorer.ExpandedPhoto.PhotoExpandedViewActivity;

                .fit()
                .centerCrop()
                .into(photosViewHolder.photoHolder, new Callback() {
                    @Override
                    public void onSuccess() {
                        photosViewHolder.photoHolder.setTag(R.integer.hasImageLoaded,
                                activity.getString(R.string.imageHasLoaded));
                    }

                    @Override
                    public void onError() {
                        photosViewHolder.photoHolder.setTag(R.integer.hasImageLoaded, null);
                    }
                });

        // Photo Id
        photosViewHolder.photoId
                .setText(String.valueOf(photos.get(viewHolder.getAdapterPosition()).id()));

        // Camera Initials
        photosViewHolder.cameraInitial
                .setText(photos.get(viewHolder.getAdapterPosition()).camera().name());

        // On click action
        photosViewHolder.photoHolderLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent goToPhotoExpandedActivity =
                        new Intent(context, PhotoExpandedViewActivity.class);
                goToPhotoExpandedActivity.putExtra(ExpandedPhotosConstants.imageUrl,