// 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;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setRetainInstance(true);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                          Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        View v = inflater.inflate(R.layout.fragment_photo_gallery, container, false);
        photoGallery = (RecyclerView)v.findViewById(R.id.rec_gallery_gallery);
        photoGallery.setLayoutManager(new GridLayoutManager(getActivityContext(), 2));
        progressBar = (ProgressBar)v.findViewById(R.id.pro_gallery_loading);
        noData = (TextView)v.findViewById(R.id.lbl_gallery_no_data);
        back = (ImageButton) v.findViewById(R.id.imb_gallery_back);
        back.setOnClickListener(new android.view.View.OnClickListener() {
            @Override
            public void onClick(android.view.View view) {
                startProfilePageActivity();
            }
        });
        return v;
    }

    private void startProfilePageActivity() {
// 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;

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setRetainInstance(true);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                          Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        View v = inflater.inflate(R.layout.fragment_photo_gallery, container, false);
        photoGallery = (RecyclerView)v.findViewById(R.id.rec_gallery_gallery);
        photoGallery.setLayoutManager(new GridLayoutManager(getActivityContext(), 2));
        progressBar = (ProgressBar)v.findViewById(R.id.pro_gallery_loading);
        noData = (TextView)v.findViewById(R.id.lbl_gallery_no_data);
        back = (ImageButton) v.findViewById(R.id.imb_gallery_back);
        back.setOnClickListener(new android.view.View.OnClickListener() {
            @Override
            public void onClick(android.view.View view) {
                startProfilePageActivity();
            }
        });
        return v;
    }

    private void startProfilePageActivity() {
        Intent i = new Intent(getActivity(), ProfilePageActivity.class);