<commit_before>package com.spiddekauga.android.ui;

import android.content.Context;
import android.preference.DialogPreference;
import android.util.AttributeSet;

/**
 * A confirm dialog preference screen
 */
public class ConfirmDialogPreference extends DialogPreference {
private Listener mListener = null;

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
	super(context, attrs, defStyleAttr, defStyleRes);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs) {
	super(context, attrs);
}

public ConfirmDialogPreference(Context context) {
	super(context);
}

/**
 * Set listener when the dialog is closed
 * @param listener listen to dialog events
 */
public void setListener(Listener listener) {
	mListener = listener;
}

//@Override
//protected void onDialogClosed(boolean positiveResult) {
//	super.onDialogClosed(positiveResult);
//	if (mListener != null) {
//		mListener.onDialogClosed(positiveResult);
//	}
//}

public interface Listener {
	/**
	 * Called when the dialog is closed
	 * @param positiveResult true if the user click the positive button<commit_msg>Fix ConfirmDialogPreference: Now calls listener<commit_after>package com.spiddekauga.android.ui;

import android.content.Context;
import android.preference.DialogPreference;
import android.util.AttributeSet;

/**
 * A confirm dialog preference screen
 */
public class ConfirmDialogPreference extends DialogPreference {
private Listener mListener = null;

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
	super(context, attrs, defStyleAttr, defStyleRes);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs) {
	super(context, attrs);
}

public ConfirmDialogPreference(Context context) {
	super(context);
}

/**
 * Set listener when the dialog is closed
 * @param listener listen to dialog events
 */
public void setListener(Listener listener) {
	mListener = listener;
}

@Override
protected void onDialogClosed(boolean positiveResult) {
	super.onDialogClosed(positiveResult);
	if (mListener != null) {
		mListener.onDialogClosed(positiveResult);
	}
}

public interface Listener {
	/**
	 * Called when the dialog is closed
	 * @param positiveResult true if the user click the positive button
{'fraction_non_alphanumeric': 0.08768511301636789, 'fraction_numerical': 0.0, 'mean_word_length': 5.882037533512064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4558415', 'n_tokens_mistral': 719, 'n_tokens_neox': 713, 'n_words': 211}