package com.bleyl.recurrence.ui;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bleyl.recurrence.BuildConfig;
import com.bleyl.recurrence.R;
import com.bleyl.recurrence.adapter.ContributionAdapter;

public class AboutActivity extends AppCompatActivity {

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

        TextView versionText = (TextView) findViewById(R.id.version);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        versionText.setText(getResources().getString(R.string.version) + " " + BuildConfig.VERSION_NAME);
    }

    public void launchEmail(View view) {
        Intent intent = new Intent(android.content.Intent.ACTION_SEND);
        intent.setType("plain/text");
        intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{getResources().getString(R.string.email)});
        this.startActivity(Intent.createChooser(intent, getResources().getString(R.string.send_email)));
    }

    public void launchAppURL(View view) {
        String url = getResources().getString(R.string.app_url);
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(url));
        startActivity(intent);
    }

    public void showLibrariesDialog(View view) {
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.root);
        LayoutInflater inflater = getLayoutInflater();
        View dialogView = inflater.inflate(R.layout.view_dialog_libraries, linearLayout, false);

        AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
        alertDialog.setTitle(getResources().getString(R.string.libraries));
        alertDialog.setView(dialogView);
        alertDialog.setPositiveButton(getResources().getString(R.string.ok), null);
        alertDialog.show();

        dialogView.findViewById(R.id.tabLink).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String url = getResources().getString(R.string.tabLink);
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(Uri.parse(url));
                startActivity(intent);
            }
        });
    }

    public void showContributorsDialog(View view) {
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.root);
        LayoutInflater inflater = getLayoutInflater();
        View dialogView = inflater.inflate(R.layout.view_dialog_contributors, linearLayout, false);

        RecyclerView recyclerView = (RecyclerView) dialogView.findViewById(R.id.contributors_recycler_view);
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);

        String[] contributor_names = getResources().getStringArray(R.array.contributors_array);
        String[] contribution_type = getResources().getStringArray(R.array.contribution_array);
        recyclerView.setAdapter(new ContributionAdapter(this, R.layout.item_contributor_list, contributor_names, contribution_type));

        AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
        alertDialog.setTitle(getResources().getString(R.string.thanks_to));
        alertDialog.setView(dialogView);
        alertDialog.setPositiveButton(getResources().getString(R.string.ok), null);
        alertDialog.show();

    }
}
@@ -3543,26 +3543,25 @@
  contributor
-_n
+N
 ames = getRe
@@ -3643,21 +3643,21 @@
 ribution
-_t
+T
 ype
+s
  = getRe
@@ -3819,10 +3819,9 @@
 utor
-_n
+N
 ames
@@ -3838,13 +3838,13 @@
 tion
-_t
+T
 ype
+s
 ));%0A

Fix array variable names