<commit_before>package sk.henrichg.phoneprofilesplus;

import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.GridView;

import com.afollestad.materialdialogs.MaterialDialog;

public class ImageViewPreferenceDialog  {

	private ImageViewPreference imageViewPreference;
	private String imageSource;
    private String imageIdentifier;
    private boolean isImageResourceID;
    private Context context;
    MaterialDialog dialog;

    public ImageViewPreferenceDialog(Context context, ImageViewPreference preference, String imgSource,
										String imageIdentifier, boolean isImageResourceID)
	{
		this.imageViewPreference = preference;
		this.imageSource = imgSource;
        this.imageIdentifier = imageIdentifier;
        this.isImageResourceID = isImageResourceID;

		this.context = context;

        MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(context)
                .title(R.string.title_activity_image_view_preference_dialog)
                .autoDismiss(false)
                .customView(R.layout.activity_imageview_resource_pref_dialog, false);

        if (imageSource.equals("resource_file"))
        {
            dialogBuilder.positiveText(R.string.imageview_resource_file_pref_dialog_gallery_btn);
            dialogBuilder.callback(new MaterialDialog.ButtonCallback() {
                                       @Override
                                       public void onPositive(MaterialDialog dialog) {
                                           // zavolat galeriu na vyzdvihnutie image
                                           imageViewPreference.startGallery();
                                           dialog.dismiss();
                                       }
                                   });
        }

        dialog = dialogBuilder.build();

        GridView gridView = (GridView)dialog.getCustomView().findViewById(R.id.imageview_resource_pref_dlg_gridview);
        gridView.setAdapter(new ImageViewPreferenceAdapter(context, imageIdentifier, isImageResourceID));

        gridView.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                imageViewPreference.setImageIdentifierAndType(ImageViewPreferenceAdapter.ThumbsIds[position], true);
                dialog.dismiss();
            }

        });

    }

    public void show() {
        dialog.show();
    }
}
<commit_msg>ImageView as material dialog<commit_after>package sk.henrichg.phoneprofilesplus;

import android.content.Context;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

import com.afollestad.materialdialogs.MaterialDialog;

public class ImageViewPreferenceDialog  {

	private ImageViewPreference imageViewPreference;
	private String imageSource;
    private String imageIdentifier;
    private boolean isImageResourceID;
    private Context context;
    MaterialDialog dialog;

    public ImageViewPreferenceDialog(Context context, ImageViewPreference preference, String imgSource,
										String imageIdentifier, boolean isImageResourceID)
	{
		this.imageViewPreference = preference;
		this.imageSource = imgSource;
        this.imageIdentifier = imageIdentifier;
        this.isImageResourceID = isImageResourceID;

		this.context = context;

        MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(context)
                .title(R.string.title_activity_image_view_preference_dialog)
                .autoDismiss(false)
                .customView(R.layout.activity_imageview_resource_pref_dialog, false);

        if (imageSource.equals("resource_file"))
        {
            dialogBuilder.positiveText(R.string.imageview_resource_file_pref_dialog_gallery_btn);
            dialogBuilder.callback(new MaterialDialog.ButtonCallback() {
                                       @Override
                                       public void onPositive(MaterialDialog dialog) {
                                           // zavolat galeriu na vyzdvihnutie image
                                           imageViewPreference.startGallery();
                                           dialog.dismiss();
                                       }
                                   });
        }

        dialog = dialogBuilder.build();

        GridView gridView = (GridView)dialog.getCustomView().findViewById(R.id.imageview_resource_pref_dlg_gridview);
        gridView.setAdapter(new ImageViewPreferenceAdapter(context, imageIdentifier, isImageResourceID));

        gridView.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                imageViewPreference.setImageIdentifierAndType(ImageViewPreferenceAdapter.ThumbsIds[position], true);
                dialog.dismiss();
            }

        });

    }

    public void show() {
        dialog.show();
    }
}

{'fraction_non_alphanumeric': 0.07048961706991808, 'fraction_numerical': 0.0, 'mean_word_length': 2.4313725490196076, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7155444', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1216, 'n_words': 227}