// Path: app/src/main/java/io/github/krtkush/marsexplorer/GeneralConstants.java
// public class GeneralConstants {
// 
//     // Rover names
//     public static final String Curiosity = "Curiosity";
//     public static final String Opportunity = "Opportunity";
//     public static final String Spirit = "Spirit";
// }


import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.github.krtkush.marsexplorer.GeneralConstants;
import io.github.krtkush.marsexplorer.R;
import timber.log.Timber;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
package io.github.krtkush.marsexplorer.Main;




public class MainActivity extends AppCompatActivity {

    @BindView(R.id.toolbar) Toolbar toolbar;
    @BindView(R.id.maxMarsTemperature) TextView maxTemperatureTextView;
    @BindView(R.id.minMarsTemperature) TextView minTemperatureTextView;
    @BindView(R.id.currentSol) TextView currentSolTextView;
    @BindView(R.id.marsPressure) TextView atmosphericPressureTextView;
    @BindView(R.id.goToCuriosityButtonBackground) ImageView goToCuriosityButtonBackground;
    @BindView(R.id.goToOpportunityButtonBackground) ImageView goToOpportunityButtonBackground;
    @BindView(R.id.goToSpiritButtonBackground) ImageView goToSpiritButtonBackground;
    @BindView(R.id.headerImage) ImageView headerImage;

    private MainActivityPresenterInteractor presenterInteractor;

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

        // Initialise butterknife, timber and the presenter layer
        ButterKnife.bind(MainActivity.this);
        Timber.tag(MainActivity.this.getClass().getSimpleName());
        presenterInteractor = new MainActivityPresenterLayer(this);

        // Setup the toolbar
        setSupportActionBar(toolbar);
        presenterInteractor.setupToolbar(getSupportActionBar());

        // Set the buttons background images
        setImages(R.drawable.curiosity, goToCuriosityButtonBackground);
        setImages(R.drawable.spirit, goToOpportunityButtonBackground);
        setImages(R.drawable.opportunity, goToSpiritButtonBackground);
        setImages(R.drawable.main_activity_header_mars_image, headerImage);
    }

    @Override
    protected void onStart() {
        super.onStart();

        // Send request to get max SOL for each rover
// Path: app/src/main/java/io/github/krtkush/marsexplorer/GeneralConstants.java
// public class GeneralConstants {
// 
//     // Rover names
//     public static final String Curiosity = "Curiosity";
//     public static final String Opportunity = "Opportunity";
//     public static final String Spirit = "Spirit";
// }


// Path: app/src/main/java/io/github/krtkush/marsexplorer/Main/MainActivity.java
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Picasso;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.github.krtkush.marsexplorer.GeneralConstants;
import io.github.krtkush.marsexplorer.R;
import timber.log.Timber;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;

package io.github.krtkush.marsexplorer.Main;




public class MainActivity extends AppCompatActivity {

    @BindView(R.id.toolbar) Toolbar toolbar;
    @BindView(R.id.maxMarsTemperature) TextView maxTemperatureTextView;
    @BindView(R.id.minMarsTemperature) TextView minTemperatureTextView;
    @BindView(R.id.currentSol) TextView currentSolTextView;
    @BindView(R.id.marsPressure) TextView atmosphericPressureTextView;
    @BindView(R.id.goToCuriosityButtonBackground) ImageView goToCuriosityButtonBackground;
    @BindView(R.id.goToOpportunityButtonBackground) ImageView goToOpportunityButtonBackground;
    @BindView(R.id.goToSpiritButtonBackground) ImageView goToSpiritButtonBackground;
    @BindView(R.id.headerImage) ImageView headerImage;

    private MainActivityPresenterInteractor presenterInteractor;

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

        // Initialise butterknife, timber and the presenter layer
        ButterKnife.bind(MainActivity.this);
        Timber.tag(MainActivity.this.getClass().getSimpleName());
        presenterInteractor = new MainActivityPresenterLayer(this);

        // Setup the toolbar
        setSupportActionBar(toolbar);
        presenterInteractor.setupToolbar(getSupportActionBar());

        // Set the buttons background images
        setImages(R.drawable.curiosity, goToCuriosityButtonBackground);
        setImages(R.drawable.spirit, goToOpportunityButtonBackground);
        setImages(R.drawable.opportunity, goToSpiritButtonBackground);
        setImages(R.drawable.main_activity_header_mars_image, headerImage);
    }

    @Override
    protected void onStart() {
        super.onStart();

        // Send request to get max SOL for each rover
        presenterInteractor.getMaxSol(GeneralConstants.Curiosity);