// Path: app/src/main/java/net/fabiszewski/ulogger/Alert.java
// static AlertDialog showAlert(Activity context, CharSequence title, int layoutResource, int iconResource) {
//     @SuppressLint("InflateParams")
//     View view = context.getLayoutInflater().inflate(layoutResource, null, false);
//     AlertDialog alertDialog = new AlertDialog.Builder(context).create();
//     alertDialog.setTitle(title);
//     alertDialog.setView(view);
//     if (iconResource > 0) {
//         alertDialog.setIcon(iconResource);
//     }
//     alertDialog.show();
//     return alertDialog;
// }


import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.core.text.BidiFormatter;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceManager;
import static net.fabiszewski.ulogger.Alert.showAlert;
        }
        return super.getSummary();
    }

    /**
     * Returns the index of the given value (in the entry values array).
     *
     * @param value The value whose index should be returned
     * @return The index of the value, or -1 if not found
     */
    @Override
    public int findIndexOfValue(String value) {
        int index = super.findIndexOfValue(value);
        if (index == -1) {
            return super.findIndexOfValue(OTHER);
        } else {
            return index;
        }
    }

    /**
     * Show dialog with EditText
     * @param preference Preference
     */
    private void showOtherDialog(Preference preference) {
        Activity context = getActivity();
        if (context == null) {
            return;
        }
        final String key = preference.getKey();
// Path: app/src/main/java/net/fabiszewski/ulogger/Alert.java
// static AlertDialog showAlert(Activity context, CharSequence title, int layoutResource, int iconResource) {
//     @SuppressLint("InflateParams")
//     View view = context.getLayoutInflater().inflate(layoutResource, null, false);
//     AlertDialog alertDialog = new AlertDialog.Builder(context).create();
//     alertDialog.setTitle(title);
//     alertDialog.setView(view);
//     if (iconResource > 0) {
//         alertDialog.setIcon(iconResource);
//     }
//     alertDialog.show();
//     return alertDialog;
// }


// Path: app/src/main/java/net/fabiszewski/ulogger/ListWithEditTextPreference.java
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.core.text.BidiFormatter;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceManager;
import static net.fabiszewski.ulogger.Alert.showAlert;

        }
        return super.getSummary();
    }

    /**
     * Returns the index of the given value (in the entry values array).
     *
     * @param value The value whose index should be returned
     * @return The index of the value, or -1 if not found
     */
    @Override
    public int findIndexOfValue(String value) {
        int index = super.findIndexOfValue(value);
        if (index == -1) {
            return super.findIndexOfValue(OTHER);
        } else {
            return index;
        }
    }

    /**
     * Show dialog with EditText
     * @param preference Preference
     */
    private void showOtherDialog(Preference preference) {
        Activity context = getActivity();
        if (context == null) {
            return;
        }
        final String key = preference.getKey();
        final AlertDialog dialog = showAlert(context,