// Path: app/src/prod/java/com/wiseass/profiler/data/auth/AuthInjection.java
// public class AuthInjection {
// 
//     public static AuthSource provideAuthSource(){
//         return FirebaseAuthService.getInstance();
//     }
// 
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/database/DatabaseInjection.java
// public class DatabaseInjection {
//     public static DatabaseSource provideDatabaseSource() {
//         return FakeDatabaseService.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/photogallery/PhotoGalleryActivity.java
// public class PhotoGalleryActivity extends AppCompatActivity{
//     private static final String GALLERY_FRAGMENT = "GALLERY_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_gallery);
// 
//         manager = this.getFragmentManager();
// 
//         ActivityCompat.requestPermissions(PhotoGalleryActivity.this,
//                 new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
//                 1);
//     }
// 
// 
//     @Override
//     public void onRequestPermissionsResult(int requestCode,
//                                            String permissions[], int[] grantResults) {
//         switch (requestCode) {
//             case 1: {
// 
//                 if (grantResults.length > 0
//                         && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//                     setUpPhotoGalleryComponent();
//                 } else {
//                     Toast.makeText(this,
//                             R.string.error_permission_denied,
//                             Toast.LENGTH_SHORT).show();
//                     Intent i = new Intent(this, ProfilePageActivity.class);
//                     startActivity(i);
//                 }
//                 return;
//             }
//         }
//     }
// 
//     public void setUpPhotoGalleryComponent (){
//         PhotoGalleryFragment fragment = (PhotoGalleryFragment)
//                 manager.findFragmentByTag(GALLERY_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = PhotoGalleryFragment.newInstance();
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_photo_gallery_fragment,
//                 GALLERY_FRAGMENT
//         );
//     }
// 
// }
// 
// 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.content.Intent;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.wiseass.profiler.R;
import com.wiseass.profiler.data.auth.AuthInjection;
import com.wiseass.profiler.data.database.DatabaseInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.photogallery.PhotoGalleryActivity;
import com.wiseass.profiler.profilepage.ProfilePageActivity;
                        presenter.onImageLoaded();
                    }

                    @Override
                    public void onError() {
                        presenter.onImageLoadFailure();
                    }
                });
    }

    @Override
    public void startProfilePageActivity() {
        Intent i = new Intent(getActivity(), ProfilePageActivity.class);
        startActivity(i);
    }

    @Override
    public void startPhotoGalleryActivity() {
        Intent i = new Intent(getActivity(), PhotoGalleryActivity.class);
        startActivity(i);
    }

    @Override
    public void setPresenter(PhotoDetailContract.Presenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public void showProgressIndicator(boolean show) {
        if (show) {
// Path: app/src/prod/java/com/wiseass/profiler/data/auth/AuthInjection.java
// public class AuthInjection {
// 
//     public static AuthSource provideAuthSource(){
//         return FirebaseAuthService.getInstance();
//     }
// 
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/database/DatabaseInjection.java
// public class DatabaseInjection {
//     public static DatabaseSource provideDatabaseSource() {
//         return FakeDatabaseService.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/photogallery/PhotoGalleryActivity.java
// public class PhotoGalleryActivity extends AppCompatActivity{
//     private static final String GALLERY_FRAGMENT = "GALLERY_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_photo_gallery);
// 
//         manager = this.getFragmentManager();
// 
//         ActivityCompat.requestPermissions(PhotoGalleryActivity.this,
//                 new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
//                 1);
//     }
// 
// 
//     @Override
//     public void onRequestPermissionsResult(int requestCode,
//                                            String permissions[], int[] grantResults) {
//         switch (requestCode) {
//             case 1: {
// 
//                 if (grantResults.length > 0
//                         && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//                     setUpPhotoGalleryComponent();
//                 } else {
//                     Toast.makeText(this,
//                             R.string.error_permission_denied,
//                             Toast.LENGTH_SHORT).show();
//                     Intent i = new Intent(this, ProfilePageActivity.class);
//                     startActivity(i);
//                 }
//                 return;
//             }
//         }
//     }
// 
//     public void setUpPhotoGalleryComponent (){
//         PhotoGalleryFragment fragment = (PhotoGalleryFragment)
//                 manager.findFragmentByTag(GALLERY_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = PhotoGalleryFragment.newInstance();
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_photo_gallery_fragment,
//                 GALLERY_FRAGMENT
//         );
//     }
// 
// }
// 
// 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/photodetail/PhotoDetailFragment.java
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.wiseass.profiler.R;
import com.wiseass.profiler.data.auth.AuthInjection;
import com.wiseass.profiler.data.database.DatabaseInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.photogallery.PhotoGalleryActivity;
import com.wiseass.profiler.profilepage.ProfilePageActivity;

                        presenter.onImageLoaded();
                    }

                    @Override
                    public void onError() {
                        presenter.onImageLoadFailure();
                    }
                });
    }

    @Override
    public void startProfilePageActivity() {
        Intent i = new Intent(getActivity(), ProfilePageActivity.class);
        startActivity(i);
    }

    @Override
    public void startPhotoGalleryActivity() {
        Intent i = new Intent(getActivity(), PhotoGalleryActivity.class);
        startActivity(i);
    }

    @Override
    public void setPresenter(PhotoDetailContract.Presenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public void showProgressIndicator(boolean show) {
        if (show) {
            progressBar.setVisibility(android.view.View.VISIBLE);