Example usage for android.app AlertDialog THEME_DEVICE_DEFAULT_LIGHT

List of usage examples for android.app AlertDialog THEME_DEVICE_DEFAULT_LIGHT

Introduction

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

Prototype

int THEME_DEVICE_DEFAULT_LIGHT

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

Click Source Link

Document

Special theme constant for #AlertDialog(Context,int) : use the device's default alert theme with a light background.

Usage

From source file:com.bruce.myrecorder.activities.BaseActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestQueue = Volley.newRequestQueue(getApplicationContext());
    progressDialog = new ProgressDialog(this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);//set progressDialog theme
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);//set progressDialog style
    progressDialog.setCancelable(false);//set progressDialog could not cancel on user interface
    progressDialog.setIndeterminate(true);//set indeterminate
}

From source file:com.arthurtimberly.fragments.BeamDetailsDialogFragment.java

@SuppressLint("NewApi")
@Override// w ww .j a  v a 2 s.c  o  m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder dialogBuilder = null;

    // AlertDialog.THEME_DEVICE_DEFAULT_LIGHT only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        dialogBuilder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {
        dialogBuilder = new AlertDialog.Builder(getActivity());

    }

    return dialogBuilder.setTitle(getString(R.string.beam_details__dialog_title))
            .setMessage(R.string.beam_details__dialog_message).setPositiveButton(
                    R.string.beam_details__dialog_button_text, new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int whichButton) {
                            startActivity(new Intent(Settings.ACTION_SETTINGS));
                        }
                    })
            .create();
}

From source file:com.fatelon.partyphotobooth.kiosk.KioskPasswordDialogFragment.java

@SuppressLint("NewApi")
@Override//  www  .j a v a 2s . c o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder dialogBuilder = null;
    Activity activity = getActivity();

    // AlertDialog.THEME_DEVICE_DEFAULT_LIGHT only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        dialogBuilder = new AlertDialog.Builder(activity, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {
        dialogBuilder = new AlertDialog.Builder(activity);
    }

    // Inflate EditText for entering the password.
    final EditText passwordView = (EditText) LayoutInflater.from(activity).inflate(R.layout.view_password,
            null);

    return dialogBuilder.setTitle(R.string.kiosk_mode__dialog_title).setView(passwordView)
            .setPositiveButton(R.string.kiosk_mode__dialog_button_positive_text,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int whichButton) {
                            KioskActivity activity = (KioskActivity) getActivity();
                            if (activity != null) {
                                Editable password = passwordView.getText();
                                KioskModeHelper helper = new KioskModeHelper(activity);
                                if (passwordView != null && helper.verifyPassword(password.toString())) {
                                    activity.exitKioskMode();
                                } else {
                                    Toast.makeText(activity, getString(R.string.kiosk_mode__error_password),
                                            Toast.LENGTH_SHORT).show();
                                }
                            }
                        }
                    })
            .setNegativeButton(R.string.kiosk_mode__dialog_button_negative_text, null).create();
}

From source file:com.arthurtimberly.fragments.ErrorDialogFragment.java

@SuppressLint("NewApi")
@Override/*from   w  w w  . j a v a 2s.c o m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();
    String title = args.getString(FRAGMENT_BUNDLE_KEY_TITLE);
    String message = args.getString(FRAGMENT_BUNDLE_KEY_MESSAGE);

    AlertDialog.Builder dialogBuilder = null;

    // AlertDialog.THEME_DEVICE_DEFAULT_LIGHT only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        dialogBuilder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {
        dialogBuilder = new AlertDialog.Builder(getActivity());
    }

    return dialogBuilder.setTitle(title).setMessage(message)
            .setPositiveButton(R.string.error__dialog_button_text, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int whichButton) {
                    Activity activity = getActivity();
                    if (activity != null) {
                        activity.finish();
                    }
                }
            }).create();
}

From source file:com.groundupworks.wings.facebook.FacebookPrivacyDialogFragment.java

@SuppressLint("NewApi")
@Override//from   w  ww  .  j a  v  a2s . c o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();
    final String albumName = args.getString(FRAGMENT_BUNDLE_KEY_ALBUM_NAME);
    final String albumGraphPath = args.getString(FRAGMENT_BUNDLE_KEY_ALBUM_GRAPH_PATH);

    AlertDialog.Builder dialogBuilder = null;

    // AlertDialog.THEME_DEVICE_DEFAULT_LIGHT only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        dialogBuilder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {
        dialogBuilder = new AlertDialog.Builder(getActivity());

    }

    return dialogBuilder.setTitle(getString(R.string.wings_facebook__privacy__dialog_title))
            .setItems(R.array.wings_facebook_privacy__privacies, new OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    handlePhotoPrivacySelection(which, albumName, albumGraphPath);
                }
            }).create();
}

From source file:com.fatelon.partyphotobooth.fragments.ErrorDialogFragment.java

@SuppressLint("NewApi")
@Override// w w  w . j  a v  a 2  s  .c om
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();
    String title = args.getString(FRAGMENT_BUNDLE_KEY_TITLE);
    String message = args.getString(FRAGMENT_BUNDLE_KEY_MESSAGE);

    AlertDialog.Builder dialogBuilder = null;

    // AlertDialog.THEME_DEVICE_DEFAULT_LIGHT only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        dialogBuilder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {
        dialogBuilder = new AlertDialog.Builder(getActivity());
    }

    return dialogBuilder.setTitle(title).setMessage(message)
            .setPositiveButton(R.string.error__dialog_button_text, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int whichButton) {
                    // Call to client.
                    ICallbacks callbacks = getCallbacks();
                    if (callbacks != null) {
                        callbacks.onExitPressed();
                    }
                }
            }).create();
}

From source file:com.outsystemscloud.andrevieira.secureDevice.java

@SuppressLint("NewApi")
private AlertDialog.Builder createDialog(CordovaInterface cordova) {
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        return new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {/*w w w  .j  a  v a2 s .c  o  m*/
        return new AlertDialog.Builder(cordova.getActivity());
    }
}

From source file:org.apache.cordova.dialogs.Notification.java

@SuppressLint("InlinedApi")
private ProgressDialog createProgressDialog(CordovaInterface cordova) {
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    if (currentapiVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        return new ProgressDialog(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {//from  w w  w.  j  ava 2 s. c o  m
        return new ProgressDialog(cordova.getActivity());
    }
}

From source file:com.fvd.nimbus.MainActivity.java

@SuppressLint("NewApi")
@Override// w  ww. j ava  2 s  . co m
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == TAKE_PHOTO) {
        if (resultCode == -1) {
            try {
                if (data != null) {
                    if (data.hasExtra("data")) {
                        Bitmap bm = data.getParcelableExtra("data");
                        photoFileName = appSettings.saveTempBitmap(bm);
                        bm.recycle();
                    }
                } else {
                    if (outputFileUri != null)
                        photoFileName = outputFileUri.getPath();
                    else
                        photoFileName = getImagePath();
                }

                if (appSettings.isFileExists(photoFileName)) {
                    Intent iPaint = new Intent();
                    iPaint.putExtra("temp", true);
                    iPaint.putExtra("path", photoFileName);
                    iPaint.setClassName("com.fvd.nimbus", "com.fvd.nimbus.PaintActivity");
                    startActivity(iPaint);
                }
                showProgress(false);
            } catch (Exception e) {
                appSettings.appendLog("main:onActivityResult: exception -  " + e.getMessage());
                showProgress(false);
            }
        } else
            showProgress(false);
    } else if (requestCode == TAKE_PICTURE) {
        if (resultCode == -1 && data != null) {
            boolean temp = false;

            try {
                Uri resultUri = data.getData();
                String drawString = resultUri.getPath();
                String galleryString = getGalleryPath(resultUri);
                if (galleryString != null && galleryString.length() > 0) {
                    drawString = galleryString;
                } else {
                    try {
                        InputStream input = getApplicationContext().getContentResolver()
                                .openInputStream(resultUri);
                        Bitmap bm = BitmapFactory.decodeStream(input);
                        drawString = appSettings.saveTempBitmap(bm);
                        bm.recycle();
                        temp = true;

                    } catch (Exception e) {
                        drawString = "";
                        showProgress(false);
                    }
                }

                if (drawString.length() > 0 && drawString.indexOf("/exposed_content/") == -1) {
                    try {
                        Intent iPaint = new Intent();
                        iPaint.putExtra("temp", temp);
                        iPaint.putExtra("path", drawString);
                        iPaint.setClassName("com.fvd.nimbus", "com.fvd.nimbus.PaintActivity");
                        startActivity(iPaint);
                    } catch (Exception e) {

                    }
                }
                showProgress(false);

            } catch (Exception e) {
                appSettings.appendLog("main:onActivityResult  " + e.getMessage());
                showProgress(false);
            }
        } else
            showProgress(false);
    } else if (requestCode == 5) {
        if (resultCode == RESULT_OK) {
            userMail = data.getStringExtra("userMail");
            userPass = data.getStringExtra("userPass");
            serverHelper.getInstance().sendOldRequest("user_register", String.format(
                    "{\"action\": \"user_register\",\"email\":\"%s\",\"password\":\"%s\",\"_client_software\": \"ff_addon\"}",
                    userMail, userPass), "");
        }
    } else if (requestCode == 6) {
        showLogin();
    } else if (requestCode == SHOW_SETTINGS) {
        switch (resultCode) {
        case RESULT_FIRST_USER + 1:
            Intent i = new Intent(getApplicationContext(), PrefsActivity.class);
            startActivity(i);
            //overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up );
            overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out);
            break;
        case RESULT_FIRST_USER + 2:
            if (appSettings.sessionId.length() == 0)
                showLogin();
            else {
                if (true || appSettings.service == "") {
                    appSettings.sessionId = "";
                    Editor e = prefs.edit();
                    e.putString("userMail", userMail);
                    e.putString("userPass", "");
                    e.putString("sessionId", appSettings.sessionId);
                    e.commit();
                    showLogin();
                } else {
                    i = new Intent(getApplicationContext(), loginWithActivity.class);
                    i.putExtra("logout", "true");
                    i.putExtra("service", appSettings.service);
                    startActivity(i);
                    overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out);
                }
            }
            break;
        case RESULT_FIRST_USER + 3:
            try {
                startActivity(new Intent(Intent.ACTION_VIEW,
                        Uri.parse("market://details?id=" + getApplicationInfo().packageName)));
            } catch (Exception e) {
            }
        case RESULT_FIRST_USER + 4:
            Uri uri = Uri.parse(
                    "http://help.everhelper.me/customer/portal/articles/1376820-nimbus-clipper-for-android---quick-guide");
            Intent it = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(it);
            //overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up );
            overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out);
            break;
        case RESULT_FIRST_USER + 5:
            final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this,
                    AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
            alertDialogBuilder.setMessage(getScriptContent("license.txt")).setCancelable(false)
                    .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            // no alert dialog shown
                            //alertDialogShown = null;
                            // canceled
                            setResult(RESULT_CANCELED);
                            // and finish
                            //finish();
                        }
                    });
            // create alert dialog
            final AlertDialog alertDialog = alertDialogBuilder.create();
            alertDialog.setTitle(getString(R.string.license_title));

            // and show
            //alertDialogShown = alertDialog;
            try {
                alertDialog.show();
            } catch (final java.lang.Exception e) {
                // nothing to do
            } catch (final java.lang.Error e) {
                // nothing to do
            }
            break;
        default:
            break;
        }
    }
}

From source file:com.remobile.dialogs.Notification.java

@SuppressLint("NewApi")
private AlertDialog.Builder createDialog() {
    int currentapiVersion = android.os.Build.VERSION.SDK_INT;
    if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        return new AlertDialog.Builder(this.cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
    } else {/*ww  w.j a v  a 2s. c om*/
        return new AlertDialog.Builder(this.cordova.getActivity());
    }
}