// Path: app/src/main/java/com/wiseass/profiler/data/photos/Photo.java
// public class Photo {
//    private String photoUri;
// 
//     public Photo(String photoUri) {
//         this.photoUri = photoUri;
//     }
// 
//     public String getPhotoUri() {
//         return photoUri;
//     }
// 
//     public void setPhotoUri(String photoUri) {
//         this.photoUri = photoUri;
//     }
// }
// 
// Path: app/src/prod/java/com/wiseass/profiler/data/photos/PhotoInjection.java
// public class PhotoInjection {
// 
//     public static PhotoSource providePhotoSource() {
//         return PhotoService.getInstance();
//     }
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/scheduler/SchedulerInjection.java
// public class SchedulerInjection {
// 
//     public static BaseSchedulerProvider provideSchedulerProvider(){
//         return ImmediateSchedulerProvider.getInstance();
//     }
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/photodetail/PhotoDetailActivity.java
// public class PhotoDetailActivity extends AppCompatActivity {
// 
//     private static final String PHOTO_DETAIL_FRAGMENT = "PHOTO_DETAIL_FRAGMENT";
//     private static final String EXTRA_PHOTO_URL = "EXTRA_PHOTO_URL";
// 
//     private FragmentManager manager;
//     private String photoURL;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_detail);
// 
//         photoURL = getIntent().getStringExtra(EXTRA_PHOTO_URL);
// 
//         if (photoURL == null){
//             startPhotoGalleryActivity();
//         }
// 
//         manager = this.getFragmentManager();
// 
//         //set up fragment
//         PhotoDetailFragment fragment = (PhotoDetailFragment)
//                 manager.findFragmentByTag(PHOTO_DETAIL_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = PhotoDetailFragment.newInstance(photoURL);
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_photo_detail_fragment,
//                 PHOTO_DETAIL_FRAGMENT
//         );
// 
//     }
// 
// 
//     private void startPhotoGalleryActivity(){
//         Intent i = new Intent(this, PhotoGalleryActivity.class);
//         startActivity(i);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/profilepage/ProfilePageActivity.java
// public class ProfilePageActivity extends AppCompatActivity {
//     private static final String PAGE_FRAGMENT = "PAGE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_profile_page);
// 
//         manager = this.getFragmentManager();
// 
//         ProfilePageFragment fragment = (ProfilePageFragment) manager.findFragmentByTag(PAGE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = ProfilePageFragment.newInstance();
//         }
// 
//         FragmentTransaction transaction = manager.beginTransaction();
//         transaction.replace(R.id.cont_profile_page_fragment, fragment, PAGE_FRAGMENT)
//                 .commit();
// 
//     }
// }


import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import com.wiseass.profiler.R;
import com.wiseass.profiler.data.photos.Photo;
import com.wiseass.profiler.data.photos.PhotoInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.photodetail.PhotoDetailActivity;
import com.wiseass.profiler.profilepage.ProfilePageActivity;
import java.util.List;
        presenter.unsubscribe();
        super.onDestroy();
    }

    public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.PhotoHolder> {

        private List<Photo> photos;
        private LayoutInflater inflater;
        private Context context;

        public GalleryAdapter(List<Photo> photos, Context c){
            this.context = c;
            this.inflater = LayoutInflater.from(c);
            this.photos = photos;
        }

        @Override
        public GalleryAdapter.PhotoHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            android.view.View view = inflater.inflate(R.layout.item_photo, parent, false);
            return new PhotoHolder(view);
        }

        @Override
        public void onBindViewHolder(final PhotoHolder holder, int position) {
            final Photo photo = photos.get(position);

            //TODO: figure out a way to solve resizing which works on all device sizes
            Picasso.with(context)
                    .load(photo.getPhotoUri())
                    .resize(600, 600)
// Path: app/src/main/java/com/wiseass/profiler/data/photos/Photo.java
// public class Photo {
//    private String photoUri;
// 
//     public Photo(String photoUri) {
//         this.photoUri = photoUri;
//     }
// 
//     public String getPhotoUri() {
//         return photoUri;
//     }
// 
//     public void setPhotoUri(String photoUri) {
//         this.photoUri = photoUri;
//     }
// }
// 
// Path: app/src/prod/java/com/wiseass/profiler/data/photos/PhotoInjection.java
// public class PhotoInjection {
// 
//     public static PhotoSource providePhotoSource() {
//         return PhotoService.getInstance();
//     }
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/scheduler/SchedulerInjection.java
// public class SchedulerInjection {
// 
//     public static BaseSchedulerProvider provideSchedulerProvider(){
//         return ImmediateSchedulerProvider.getInstance();
//     }
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/photodetail/PhotoDetailActivity.java
// public class PhotoDetailActivity extends AppCompatActivity {
// 
//     private static final String PHOTO_DETAIL_FRAGMENT = "PHOTO_DETAIL_FRAGMENT";
//     private static final String EXTRA_PHOTO_URL = "EXTRA_PHOTO_URL";
// 
//     private FragmentManager manager;
//     private String photoURL;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_detail);
// 
//         photoURL = getIntent().getStringExtra(EXTRA_PHOTO_URL);
// 
//         if (photoURL == null){
//             startPhotoGalleryActivity();
//         }
// 
//         manager = this.getFragmentManager();
// 
//         //set up fragment
//         PhotoDetailFragment fragment = (PhotoDetailFragment)
//                 manager.findFragmentByTag(PHOTO_DETAIL_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = PhotoDetailFragment.newInstance(photoURL);
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_photo_detail_fragment,
//                 PHOTO_DETAIL_FRAGMENT
//         );
// 
//     }
// 
// 
//     private void startPhotoGalleryActivity(){
//         Intent i = new Intent(this, PhotoGalleryActivity.class);
//         startActivity(i);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/profilepage/ProfilePageActivity.java
// public class ProfilePageActivity extends AppCompatActivity {
//     private static final String PAGE_FRAGMENT = "PAGE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_profile_page);
// 
//         manager = this.getFragmentManager();
// 
//         ProfilePageFragment fragment = (ProfilePageFragment) manager.findFragmentByTag(PAGE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = ProfilePageFragment.newInstance();
//         }
// 
//         FragmentTransaction transaction = manager.beginTransaction();
//         transaction.replace(R.id.cont_profile_page_fragment, fragment, PAGE_FRAGMENT)
//                 .commit();
// 
//     }
// }


// Path: app/src/main/java/com/wiseass/profiler/photogallery/PhotoGalleryFragment.java
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import com.wiseass.profiler.R;
import com.wiseass.profiler.data.photos.Photo;
import com.wiseass.profiler.data.photos.PhotoInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.photodetail.PhotoDetailActivity;
import com.wiseass.profiler.profilepage.ProfilePageActivity;
import java.util.List;

        presenter.unsubscribe();
        super.onDestroy();
    }

    public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.PhotoHolder> {

        private List<Photo> photos;
        private LayoutInflater inflater;
        private Context context;

        public GalleryAdapter(List<Photo> photos, Context c){
            this.context = c;
            this.inflater = LayoutInflater.from(c);
            this.photos = photos;
        }

        @Override
        public GalleryAdapter.PhotoHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            android.view.View view = inflater.inflate(R.layout.item_photo, parent, false);
            return new PhotoHolder(view);
        }

        @Override
        public void onBindViewHolder(final PhotoHolder holder, int position) {
            final Photo photo = photos.get(position);

            //TODO: figure out a way to solve resizing which works on all device sizes
            Picasso.with(context)
                    .load(photo.getPhotoUri())
                    .resize(600, 600)
                    .centerCrop()