Example usage for android.app AlertDialog THEME_HOLO_DARK

List of usage examples for android.app AlertDialog THEME_HOLO_DARK

Introduction

In this page you can find the example usage for android.app AlertDialog THEME_HOLO_DARK.

Prototype

int THEME_HOLO_DARK

To view the source code for android.app AlertDialog THEME_HOLO_DARK.

Click Source Link

Document

Special theme constant for #AlertDialog(Context,int) : use the holographic alert theme with a dark background.

Usage

From source file:Main.java

/**
 * Alert and quite the activity/*from  ww w . j  ava2  s.  c  o  m*/
 * @param message
 */
public static void alertAbort(final Activity activity, String message) {
    new AlertDialog.Builder(activity, AlertDialog.THEME_HOLO_DARK).setTitle("Problem...").setMessage(message)
            .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    activity.finish();
                }
            }).setIcon(android.R.drawable.ic_dialog_alert).show();
}

From source file:com.albertcbraun.cms50fw.alert.UIAlertDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();//w  w  w.j  a v  a 2 s. co  m
    String alertMessage = args.getString(ALERT_MESSAGE_KEY);
    final MainActivity activity = (MainActivity) getActivity();
    AlertDialog.Builder builder = new AlertDialog.Builder(activity, AlertDialog.THEME_HOLO_DARK);
    builder.setMessage(alertMessage).setTitle(ALERT_DIALOG_TITLE).setPositiveButton(DISMISS_DIALOG_BUTTON_TEXT,
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    activity.stopAlertSound();
                    activity.disableAlertSound();
                }
            });
    return builder.create();
}

From source file:org.catrobat.paintroid.dialog.DialogAbout.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override/*from w  w  w.  j  ava2 s .  c o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    LayoutInflater inflater = getActivity().getLayoutInflater();
    AlertDialog.Builder builder;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        builder = new AlertDialog.Builder(getActivity());
    } else {
        builder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_HOLO_DARK);
    }

    builder.setTitle(R.string.about_title);
    View view = inflater.inflate(R.layout.dialog_about, null);

    TextView aboutVersionNameTextView = (TextView) view.findViewById(R.id.dialog_about_version_name_text_view);
    String versionName = PaintroidApplication.getVersionName(getActivity());
    aboutVersionNameTextView.setText(R.string.about_version);
    aboutVersionNameTextView.append(" " + versionName);

    TextView aboutTextView = (TextView) view.findViewById(R.id.about_tview_Text);
    String aboutText = String.format(getActivity().getString(R.string.about_content),
            getActivity().getString(R.string.licence_type_paintroid));
    aboutTextView.setText(aboutText);

    TextView aboutUrlTextView = (TextView) view.findViewById(R.id.about_tview_Url);
    aboutUrlTextView.setMovementMethod(LinkMovementMethod.getInstance());
    Resources resources = getActivity().getResources();
    String paintroidLicence = String.format(resources.getString(R.string.about_link_template),
            resources.getString(R.string.license_url), resources.getString(R.string.about_licence_url_text));
    aboutUrlTextView.append(Html.fromHtml(paintroidLicence));
    aboutUrlTextView.append("\n\n");
    String aboutCatroid = String.format(resources.getString(R.string.about_link_template),
            resources.getString(R.string.catroid_url), resources.getString(R.string.about_catroid_url_text));
    aboutUrlTextView.append(Html.fromHtml(aboutCatroid));
    aboutUrlTextView.append("\n");

    builder.setView(view);
    builder.setNeutralButton(R.string.done, this);

    return builder.create();

}

From source file:org.catrobat.paintroid.dialog.InfoDialog.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override/*from   ww w.ja  v  a 2 s  .c  om*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        builder = new AlertDialog.Builder(getActivity());
    } else {
        builder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_HOLO_DARK);
    }

    if (mTitleResource != NULL_RESOURCE) {
        builder.setTitle(mTitleResource);
    }

    int imageResource = mDialogType.getImageResource();
    if (imageResource != NULL_RESOURCE) {
        builder.setIcon(imageResource);
    }

    if (mMessageResource != NULL_RESOURCE) {
        builder.setMessage(mMessageResource);
    }

    builder.setNeutralButton(android.R.string.ok, this);
    return builder.create();
}

From source file:org.catrobat.paintroid.dialog.DialogSaveFile.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override//from w w w.ja v a 2 s  .  com
public Dialog onCreateDialog(Bundle savedInstanceState) {

    LayoutInflater inflater = getActivity().getLayoutInflater();
    AlertDialog.Builder builder;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        builder = new AlertDialog.Builder(mContext);
    } else {
        builder = new AlertDialog.Builder(mContext, AlertDialog.THEME_HOLO_DARK);
    }
    builder.setTitle(R.string.dialog_save_title);
    View view = inflater.inflate(R.layout.dialog_save_file, null);
    mEditText = (EditText) view.findViewById(R.id.dialog_save_file_edit_text);
    if (actualFilename != null) {
        mEditText.setText(actualFilename);
    } else {
        mEditText.setHint(getDefaultFileName());
    }
    builder.setView(view);
    builder.setPositiveButton(R.string.ok, this);
    builder.setNegativeButton(R.string.cancel, this);
    return builder.create();
}

From source file:org.catrobat.paintroid.dialog.BrushPickerDialog.java

@TargetApi(11)
@Override//  w  ww  . ja  v  a2 s  .  c o  m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    LayoutInflater inflator = getActivity().getLayoutInflater();
    AlertDialog.Builder builder;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        builder = new AlertDialog.Builder(mContext);

    } else {
        builder = new AlertDialog.Builder(mContext, AlertDialog.THEME_HOLO_DARK);
    }
    builder.setTitle(R.string.stroke_title);
    View view = inflator.inflate(R.layout.dialog_stroke, null);

    ImageButton btn_circle = (ImageButton) view.findViewById(R.id.stroke_ibtn_circle);
    btn_circle.setOnClickListener(this);

    ImageButton btn_rect = (ImageButton) view.findViewById(R.id.stroke_ibtn_rect);
    btn_rect.setOnClickListener(this);

    mRbtnCircle = (RadioButton) view.findViewById(R.id.stroke_rbtn_circle);
    mRbtnCircle.setOnClickListener(this);

    mRbtnRect = (RadioButton) view.findViewById(R.id.stroke_rbtn_rect);
    mRbtnRect.setOnClickListener(this);

    mBrushWidthSeekBar = (SeekBar) view.findViewById(R.id.stroke_width_seek_bar);

    mBrushWidthSeekBar.setOnSeekBarChangeListener(new OnBrushChangedWidthSeekBarListener());

    mBrushSizeText = (TextView) view.findViewById(R.id.stroke_width_width_text);

    builder.setView(view);
    builder.setNeutralButton(R.string.done, this);

    return builder.create();

}

From source file:uk.org.rivernile.edinburghbustracker.android.fragments.dialogs.AboutDialogFragment.java

/**
 * Attempt to get a THEME_HOLO_DARK dialog when on Honeycomb (Android 3.0)
 * or greater./* w  w  w  .  j a va2  s .  com*/
 * 
 * @param context The Activity context.
 * @return An AlertDialog.Builder instance to create the Dialog on top of.
 */
@TargetApi(11)
public static AlertDialog.Builder getHoneycombDialog(final Context context) {
    try {
        // Get the class.
        Class cls = AlertDialog.Builder.class;
        Class[] partypes = new Class[2];
        // Set the parameter types.
        partypes[0] = Context.class;
        partypes[1] = Integer.TYPE;
        // Get the constructor.
        Constructor ct = cls.getConstructor(partypes);
        // Set the arguments
        Object[] arglist = new Object[2];
        arglist[0] = context;
        arglist[1] = Integer.valueOf(AlertDialog.THEME_HOLO_DARK);
        // Call the constructor, returning the new instance.
        return (AlertDialog.Builder) ct.newInstance(arglist);
    } catch (NoSuchMethodException e) {

    } catch (java.lang.InstantiationException e) {

    } catch (IllegalAccessException e) {

    } catch (InvocationTargetException e) {

    }

    return null;
}

From source file:com.amagi82.kerbalspaceapp.MainActivity.java

private void selectItem(int position) {
    switch (position) {
    case 1:/*w  ww  . j a  v  a 2s.  c  o  m*/
        startActivity(new Intent(this, MissionPlanner.class));
        break;
    case 2:
        startActivity(new Intent(this, Settings.class));
        break;
    case 4:
        // opens the KSP forum feedback thread
        startActivity(new Intent(Intent.ACTION_VIEW,
                Uri.parse("http://forum.kerbalspaceprogram.com/threads/82203-Kerbal-Space-App-for-Android!")));
        break;
    case 5:
        // alertdialog for the About section
        AlertDialog.Builder builder = new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK);
        builder.setMessage(getResources().getString(R.string.app_name) + " v" + version
                + getResources().getString(R.string.version)).setNeutralButton(R.string.dismiss, null).show();
        break;
    default:
        break;
    }
    mDrawerList.setItemChecked(position, true);
    // setTitle(dataList.get(position).getItemName());
    mDrawerLayout.closeDrawer(mDrawerList);
}

From source file:com.example.android.tabbedroombookingtimetabledisplay.MainFragmentActivity.java

private void createADialog() {
    AlertDialog.Builder noConnectionDialog = new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK);
    noConnectionDialog.setTitle("No Internet Connection!");
    noConnectionDialog.setMessage("Please make sure that you are connected to internet.");
    noConnectionDialog.setPositiveButton("Quit", new DialogInterface.OnClickListener() {

        @Override/*w w w  .j  ava2  s .  co m*/
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
            finish();
            System.exit(0);
        }
    });

    AlertDialog alertDialog = noConnectionDialog.create();

    alertDialog.show();
}

From source file:com.amagi82.kerbalspaceapp.Settings.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.action_help) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK);
        builder.setTitle(R.string.action_help)
                .setItems(R.array.help_descriptions, new DialogInterface.OnClickListener() {
                    @Override// w  w  w.  j  a v a2 s  .co  m
                    public void onClick(DialogInterface dialog, int which) {
                        switch (which) {
                        case 0:
                            builder.setTitle(R.string.clearance).setMessage(R.string.help_clearance)
                                    .setNeutralButton(R.string.dismiss, null).show();
                            break;
                        case 1:
                            builder.setTitle(R.string.safety_margins).setMessage(R.string.help_margins)
                                    .setNeutralButton(R.string.dismiss, null).show();
                            break;
                        case 2:
                            builder.setTitle(R.string.inclination_efficiency)
                                    .setMessage(R.string.help_inclination)
                                    .setNeutralButton(R.string.dismiss, null).show();
                            break;
                        }
                    }
                }).setNeutralButton(R.string.dismiss, null).show();
    }
    if (item.getItemId() == android.R.id.home) {
        NavUtils.navigateUpFromSameTask(this);
    }
    return true;
}