<commit_before>package sample.github.nisrulz.usingretrofit2;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import sample.github.nisrulz.usingretrofit2.list.ListAdapter;
import sample.github.nisrulz.usingretrofit2.model.People;
import sample.github.nisrulz.usingretrofit2.model.PeopleResponse;
import sample.github.nisrulz.usingretrofit2.rest.ApiClient;
import sample.github.nisrulz.usingretrofit2.rest.ApiInterface;

public class MainActivity extends AppCompatActivity {

  private static final String TAG = MainActivity.class.getSimpleName();

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

    final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_peoples);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));

    ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);

    Call<PeopleResponse> call = apiService.getPeople();
    call.enqueue(new Callback<PeopleResponse>() {
      @Override
      public void onResponse(Call<PeopleResponse> call, Response<PeopleResponse> response) {
        List<People> peoples = response.body().getPeoples();
        recyclerView.setAdapter(new ListAdapter(peoples, R.layout.list_item_people));
      }

      @Override public void onFailure(Call<PeopleResponse> call, Throwable t) {
        // Log error here since request failed
        Log.e(TAG, t.toString());
      }
    });
  }
}<commit_msg>(*) added a progress dialogue to UsingRetrofit2<commit_after>package sample.github.nisrulz.usingretrofit2;

import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.Toast;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import sample.github.nisrulz.usingretrofit2.list.ListAdapter;
import sample.github.nisrulz.usingretrofit2.model.People;
import sample.github.nisrulz.usingretrofit2.model.PeopleResponse;
import sample.github.nisrulz.usingretrofit2.rest.ApiClient;
import sample.github.nisrulz.usingretrofit2.rest.ApiInterface;

public class MainActivity extends AppCompatActivity {

  private static final String TAG = MainActivity.class.getSimpleName();

  private ProgressDialog progressDialog;

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

    progressDialog = new ProgressDialog(this);
    progressDialog.setMessage("Loading..");
    progressDialog.setIndeterminate(true);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();

    final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_peoples);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));

    ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);

    Call<PeopleResponse> call = apiService.getPeople();
    call.enqueue(new Callback<PeopleResponse>() {
      @Override
      public void onResponse(Call<PeopleResponse> call, Response<PeopleResponse> response) {
        List<People> peoples = response.body().getPeoples();
        recyclerView.setAdapter(new ListAdapter(peoples, R.layout.list_item_people));
        progressDialog.dismiss();
      }

      @Override public void onFailure(Call<PeopleResponse> call, Throwable t) {
        // Log error here since request failed
        Log.e(TAG, t.toString());
        Toast.makeText(MainActivity.this, t.toString(), Toast.LENGTH_SHORT).show();
        progressDialog.dismiss();
      }
    });
  }
}
{'fraction_non_alphanumeric': 0.101923557332001, 'fraction_numerical': 0.006245316012990257, 'mean_word_length': 5.04833836858006, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2501819', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1152, 'n_words': 207}