<commit_before>package com.prolificinteractive.materialdialog;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;

/**
 * A subclass of Dialog that can display one, two or three buttons,
 * a title and content with a Material theme
 */
public class MaterialDialog extends Dialog {

  private final LinearLayout topPanel;
  private final LinearLayout contentPanel;
  private final FrameLayout customPanel;
  private final ViewGroup buttonPanel;

  private final ImageView iconView;
  private final TextView titleView;
  private final TextView messageView;
  private final View noButtonSpacer;

  private final TextView buttonPositive;
  private final TextView buttonNegative;
  private final TextView buttonNeutral;

  private final ViewGroup customContainer;
  private final ListView listView;
  private final ScrollView scrollView;

  /**
   * Construct an MaterialDialog that uses the theme defined using
   * {@link com.prolificinteractive.materialdialog.R.attr#MaterialDialogTheme}
   * or defaulting to a light theme
   */
  public MaterialDialog(Context context) {
    this(context, 0);
  }

  /**
   * Construct an MaterialDialog that uses an explicit theme.
   * The Backport library defines both a light and dark themes.
   *
   * @see com.prolificinteractive.materialdialog.R.style#Theme_MaterialDialog_Light
   * @see com.prolificinteractive.materialdialog.R.style#Theme_MaterialDialog_Dark
   */
  public MaterialDialog(Context context, int theme) {
    super(context, getDialogTheme(context, theme));
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.mdb__dialog);

    topPanel = (LinearLayout) findViewById(R.id.mdb__topPanel);
    contentPanel = (LinearLayout) findViewById(R.id.mdb__contentPanel);
    customPanel = (FrameLayout) findViewById(R.id.mdb__customPanel);
    buttonPanel = (ViewGroup) findViewById(R.id.mdb__buttonPanel);

    iconView = (ImageView) findViewById(android.R.id.icon);
    titleView = (TextView) findViewById(R.id.mdb__title);
    messageView = (TextView) findViewById(R.id.mdb__message);
    noButtonSpacer = findViewById(R.id.mdb__textSpacerNoButtons);

    customContainer = (ViewGroup) findViewById(R.id.mdb__custom);
    listView = (ListView) findViewById(R.id.mdb__list);
    scrollView = (ScrollView) findViewById(R.id.mdb__scroll);

    buttonPositive = (TextView) findViewById(android.R.id.button1);
    buttonNegative = (TextView) findViewById(android.R.id.button2);
    buttonNeutral = (TextView) findViewById(android.R.id.button3);
  }

  /**
   * Get the list view used in the dialog
   *
   * @return the ListView
   */
  public ListView getListView() {
    return listView;
  }

  /**
   * Set the title text for this dialog<commit_msg>Change id of custom view container to match system and documentation<commit_after>package com.prolificinteractive.materialdialog;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;

/**
 * A subclass of Dialog that can display one, two or three buttons,
 * a title and content with a Material theme
 */
public class MaterialDialog extends Dialog {

  private final LinearLayout topPanel;
  private final LinearLayout contentPanel;
  private final FrameLayout customPanel;
  private final ViewGroup buttonPanel;

  private final ImageView iconView;
  private final TextView titleView;
  private final TextView messageView;
  private final View noButtonSpacer;

  private final TextView buttonPositive;
  private final TextView buttonNegative;
  private final TextView buttonNeutral;

  private final ViewGroup customContainer;
  private final ListView listView;
  private final ScrollView scrollView;

  /**
   * Construct an MaterialDialog that uses the theme defined using
   * {@link com.prolificinteractive.materialdialog.R.attr#MaterialDialogTheme}
   * or defaulting to a light theme
   */
  public MaterialDialog(Context context) {
    this(context, 0);
  }

  /**
   * Construct an MaterialDialog that uses an explicit theme.
   * The Backport library defines both a light and dark themes.
   *
   * @see com.prolificinteractive.materialdialog.R.style#Theme_MaterialDialog_Light
   * @see com.prolificinteractive.materialdialog.R.style#Theme_MaterialDialog_Dark
   */
  public MaterialDialog(Context context, int theme) {
    super(context, getDialogTheme(context, theme));
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.mdb__dialog);

    topPanel = (LinearLayout) findViewById(R.id.mdb__topPanel);
    contentPanel = (LinearLayout) findViewById(R.id.mdb__contentPanel);
    customPanel = (FrameLayout) findViewById(R.id.mdb__customPanel);
    buttonPanel = (ViewGroup) findViewById(R.id.mdb__buttonPanel);

    iconView = (ImageView) findViewById(android.R.id.icon);
    titleView = (TextView) findViewById(R.id.mdb__title);
    messageView = (TextView) findViewById(R.id.mdb__message);
    noButtonSpacer = findViewById(R.id.mdb__textSpacerNoButtons);

    customContainer = (ViewGroup) findViewById(android.R.id.custom);
    listView = (ListView) findViewById(R.id.mdb__list);
    scrollView = (ScrollView) findViewById(R.id.mdb__scroll);

    buttonPositive = (TextView) findViewById(android.R.id.button1);
    buttonNegative = (TextView) findViewById(android.R.id.button2);
    buttonNeutral = (TextView) findViewById(android.R.id.button3);
  }

  /**
   * Get the list view used in the dialog
   *
   * @return the ListView
   */
  public ListView getListView() {
    return listView;
  }

  /**
   * Set the title text for this dialog
{'fraction_non_alphanumeric': 0.08737433471318747, 'fraction_numerical': 0.0011827321111768185, 'mean_word_length': 4.852076124567474, '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': '2147132', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1863, 'n_words': 491}