Exemplo n.º 1
0
  /**
   * Create the default full dialog.
   *
   * @param context The Context in which the Dialog should run. In particular, ituses the window
   *     manager and theme from this context to present its UI.
   * @param theme A style resource describing the theme to use for the window.If 0, the default
   *     dialog theme will be used.
   * @param buttonStyle One button or Two button
   * @return The Object of the TCLAlertDialogGray.
   */
  public static TCLAlertDialogEspecial makeDefaultFullDialog(
      Context context, int theme, int buttonStyle) {
    dialog = TCLAlertDialogEspecial.makeFullDialog(context, theme);

    if (buttonStyle == TCLAlertDialogEspecial.TWO_BUTTON) {
      dialog.setButton(context, TCLAlertDialogEspecial.TWO_BUTTON);
      Button bt1 = dialog.getLeftButton();
      bt1.setText(com.android.internal.R.string.tcl_dialog_ok);
      Button bt2 = dialog.getRightButton();
      bt2.setText(com.android.internal.R.string.tcl_dialog_cancle);
    } else if (buttonStyle == TCLAlertDialogEspecial.ONE_BUTTON) {
      dialog.setButton(context, TCLAlertDialogEspecial.ONE_BUTTON);
      Button bt3 = dialog.getLeftButton();
      bt3.setText(com.android.internal.R.string.tcl_dialog_ok);
    } else if (buttonStyle == TCLAlertDialogEspecial.THREE_BUTTON) {
      dialog.setButton(context, TCLAlertDialogEspecial.THREE_BUTTON);
      Button bt1 = dialog.getLeftButton();
      bt1.setText(com.android.internal.R.string.tcl_dialog_ok);
      Button bt2 = dialog.getRightButton();
      bt2.setText(com.android.internal.R.string.tcl_dialog_cancle);
      Button bt3 = dialog.getCenterButton();
      bt3.setText(com.android.internal.R.string.tcl_dialog_alonelistener);
    }
    return dialog;
  }