use of android.app.Dialog in project facebook-android-sdk by facebook.
the class DeviceAuthDialog method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
dialog = new Dialog(getActivity(), R.style.com_facebook_auth_dialog);
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = initializeContentView(DeviceRequestsHelper.isAvailable() && !this.isRetry);
dialog.setContentView(view);
return dialog;
}
use of android.app.Dialog in project stetho by facebook.
the class DialogFragmentDescriptor method getViewAndBoundsForHighlighting.
@Nullable
@Override
public View getViewAndBoundsForHighlighting(Object element, Rect bounds) {
final Descriptor.Host host = getHost();
Dialog dialog = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
dialog = mAccessor.getDialog(element);
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(dialog);
}
return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(dialog, bounds);
}
use of android.app.Dialog in project WordPress-Android by wordpress-mobile.
the class AlertUtils method showAlert.
/**
* Show Alert Dialog
* @param context
* @param titleId
* @param message
*/
public static void showAlert(Context context, int titleId, String message) {
Dialog dlg = new AlertDialog.Builder(context).setTitle(titleId).setPositiveButton(android.R.string.ok, null).setMessage(message).create();
dlg.show();
}
use of android.app.Dialog in project WordPress-Android by wordpress-mobile.
the class AlertUtils method showAlert.
/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
*/
public static void showAlert(Context context, int titleId, int messageId) {
Dialog dlg = new AlertDialog.Builder(context).setTitle(titleId).setPositiveButton(android.R.string.ok, null).setMessage(messageId).create();
dlg.show();
}
use of android.app.Dialog in project platform_frameworks_base by android.
the class DialogPreference method showDialog.
/**
* Shows the dialog associated with this Preference. This is normally initiated
* automatically on clicking on the preference. Call this method if you need to
* show the dialog on some other event.
*
* @param state Optional instance state to restore on the dialog
*/
protected void showDialog(Bundle state) {
Context context = getContext();
mWhichButtonClicked = DialogInterface.BUTTON_NEGATIVE;
mBuilder = new AlertDialog.Builder(context).setTitle(mDialogTitle).setIcon(mDialogIcon).setPositiveButton(mPositiveButtonText, this).setNegativeButton(mNegativeButtonText, this);
View contentView = onCreateDialogView();
if (contentView != null) {
onBindDialogView(contentView);
mBuilder.setView(contentView);
} else {
mBuilder.setMessage(mDialogMessage);
}
onPrepareDialogBuilder(mBuilder);
getPreferenceManager().registerOnActivityDestroyListener(this);
// Create the dialog
final Dialog dialog = mDialog = mBuilder.create();
if (state != null) {
dialog.onRestoreInstanceState(state);
}
if (needInputMethod()) {
requestInputMethod(dialog);
}
dialog.setOnDismissListener(this);
dialog.show();
}
Aggregations