// Path: android/app/src/main/java/com/ustwo/sample/data/Commit.java
// public class Commit {
//     public String message;
//     public Author author;
// 
//     public class Author {
//         public String name;
//         public String email;
//         public String date;
//     }
// }
// 
// Path: android/app/src/main/java/com/ustwo/sample/data/CommitSummary.java
// public class CommitSummary {
//     public String sha;
//     public Commit commit;
// 
//     public class Commit {
//         public Author author;
//         public String message;
//     }
// 
//     public class Author {
//         public String date;
//     }
// }
// 
// Path: android/app/src/main/java/com/ustwo/sample/data/GitHub.java
// public interface GitHub {
//     @GET("/repos/{username}/{repo}")
//     void repository(@Path("username") String username,
//                     @Path("repo") String repo,
//                     Callback<RepositoryInfo> commit);
// 
//     @GET("/repos/{username}/{repo}/commits")
//     void commitList(@Path("username") String username,
//                     @Path("repo") String repo,
//                     Callback<List<CommitSummary>> commit);
// 
//     @GET("/repos/{username}/{repo}/git/commits/{commit}")
//     void commit(@Path("username") String username,
//                 @Path("repo") String repo,
//                 @Path("commit") String commit,
//                 Callback<Commit> user);
// }


import android.widget.TextView;
import com.ustwo.sample.data.Commit;
import com.ustwo.sample.data.CommitSummary;
import com.ustwo.sample.data.GitHub;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
    }

    private void retrieveCommitInfo(String commit) {
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(getString(R.string.app_endpoint_url))
                .build();

        GitHub service = restAdapter.create(GitHub.class);
        service.commit(getString(R.string.default_repository_user), getString(R.string.default_repository_name), commit, new Callback<Commit>() {
            @Override
            public void success(Commit commit, Response response) {
                mProgressDialog.cancel();
                updateUI(commit);
            }

            @Override
            public void failure(RetrofitError error) {
                mProgressDialog.cancel();
                Log.e(TAG, "Failed to get full commit information", error);
            }
        });
    }

    private void updateUI(Commit commit) {
        ((TextView) findViewById(R.id.commit_detail_textview_name)).setText(commit.author.name);
        ((TextView) findViewById(R.id.commit_detail_textview_email)).setText(commit.author.email);
        ((TextView) findViewById(R.id.commit_detail_textview_date)).setText(commit.author.date);
        ((TextView) findViewById(R.id.commit_detail_textview_message)).setText(commit.message);
    }

// Path: android/app/src/main/java/com/ustwo/sample/data/Commit.java
// public class Commit {
//     public String message;
//     public Author author;
// 
//     public class Author {
//         public String name;
//         public String email;
//         public String date;
//     }
// }
// 
// Path: android/app/src/main/java/com/ustwo/sample/data/CommitSummary.java
// public class CommitSummary {
//     public String sha;
//     public Commit commit;
// 
//     public class Commit {
//         public Author author;
//         public String message;
//     }
// 
//     public class Author {
//         public String date;
//     }
// }
// 
// Path: android/app/src/main/java/com/ustwo/sample/data/GitHub.java
// public interface GitHub {
//     @GET("/repos/{username}/{repo}")
//     void repository(@Path("username") String username,
//                     @Path("repo") String repo,
//                     Callback<RepositoryInfo> commit);
// 
//     @GET("/repos/{username}/{repo}/commits")
//     void commitList(@Path("username") String username,
//                     @Path("repo") String repo,
//                     Callback<List<CommitSummary>> commit);
// 
//     @GET("/repos/{username}/{repo}/git/commits/{commit}")
//     void commit(@Path("username") String username,
//                 @Path("repo") String repo,
//                 @Path("commit") String commit,
//                 Callback<Commit> user);
// }


// Path: android/app/src/main/java/com/ustwo/sample/CommitDetailActivity.java
import android.widget.TextView;
import com.ustwo.sample.data.Commit;
import com.ustwo.sample.data.CommitSummary;
import com.ustwo.sample.data.GitHub;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;

    }

    private void retrieveCommitInfo(String commit) {
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(getString(R.string.app_endpoint_url))
                .build();

        GitHub service = restAdapter.create(GitHub.class);
        service.commit(getString(R.string.default_repository_user), getString(R.string.default_repository_name), commit, new Callback<Commit>() {
            @Override
            public void success(Commit commit, Response response) {
                mProgressDialog.cancel();
                updateUI(commit);
            }

            @Override
            public void failure(RetrofitError error) {
                mProgressDialog.cancel();
                Log.e(TAG, "Failed to get full commit information", error);
            }
        });
    }

    private void updateUI(Commit commit) {
        ((TextView) findViewById(R.id.commit_detail_textview_name)).setText(commit.author.name);
        ((TextView) findViewById(R.id.commit_detail_textview_email)).setText(commit.author.email);
        ((TextView) findViewById(R.id.commit_detail_textview_date)).setText(commit.author.date);
        ((TextView) findViewById(R.id.commit_detail_textview_message)).setText(commit.message);
    }

    public static Intent getIntent(Context context, CommitSummary commit) {