Search in sources :

Example 11 with Dialog

use of android.app.Dialog in project MyDiary by erttyy8821.

the class ColorPickerFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    // request a window without the title
    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    oldColor = getArguments().getInt("oldColor", 0);
    viewId = getArguments().getInt("viewId", View.NO_ID);
    return dialog;
}
Also used : Dialog(android.app.Dialog)

Example 12 with Dialog

use of android.app.Dialog in project MyDiary by erttyy8821.

the class ReleaseNoteDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    // request a window without the title
    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    return dialog;
}
Also used : Dialog(android.app.Dialog)

Example 13 with Dialog

use of android.app.Dialog in project android_frameworks_base by ParanoidAndroid.

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();
}
Also used : Context(android.content.Context) AlertDialog(android.app.AlertDialog) Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) TextView(android.widget.TextView) View(android.view.View)

Example 14 with Dialog

use of android.app.Dialog in project android_frameworks_base by ParanoidAndroid.

the class PreferenceScreen method showDialog.

private void showDialog(Bundle state) {
    Context context = getContext();
    if (mListView != null) {
        mListView.setAdapter(null);
    }
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View childPrefScreen = inflater.inflate(com.android.internal.R.layout.preference_list_fragment, null);
    mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
    bind(mListView);
    // Set the title bar if title is available, else no title bar
    final CharSequence title = getTitle();
    Dialog dialog = mDialog = new Dialog(context, context.getThemeResId());
    if (TextUtils.isEmpty(title)) {
        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    } else {
        dialog.setTitle(title);
    }
    dialog.setContentView(childPrefScreen);
    dialog.setOnDismissListener(this);
    if (state != null) {
        dialog.onRestoreInstanceState(state);
    }
    // Add the screen to the list of preferences screens opened as dialogs
    getPreferenceManager().addPreferencesScreen(dialog);
    dialog.show();
}
Also used : Context(android.content.Context) Dialog(android.app.Dialog) LayoutInflater(android.view.LayoutInflater) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 15 with Dialog

use of android.app.Dialog in project android_frameworks_base by ParanoidAndroid.

the class PreferenceScreen method onSaveInstanceState.

@Override
protected Parcelable onSaveInstanceState() {
    final Parcelable superState = super.onSaveInstanceState();
    final Dialog dialog = mDialog;
    if (dialog == null || !dialog.isShowing()) {
        return superState;
    }
    final SavedState myState = new SavedState(superState);
    myState.isDialogShowing = true;
    myState.dialogBundle = dialog.onSaveInstanceState();
    return myState;
}
Also used : Dialog(android.app.Dialog) Parcelable(android.os.Parcelable)

Aggregations

Dialog (android.app.Dialog)356 View (android.view.View)109 AlertDialog (android.app.AlertDialog)99 DialogInterface (android.content.DialogInterface)87 TextView (android.widget.TextView)76 AlertDialog (android.support.v7.app.AlertDialog)48 Intent (android.content.Intent)38 EditText (android.widget.EditText)34 ListView (android.widget.ListView)34 LayoutInflater (android.view.LayoutInflater)32 Context (android.content.Context)31 ProgressDialog (android.app.ProgressDialog)29 AdapterView (android.widget.AdapterView)29 WindowManager (android.view.WindowManager)28 ImageView (android.widget.ImageView)25 LinearLayout (android.widget.LinearLayout)25 Test (org.junit.Test)25 BrowserDialog (acr.browser.lightning.dialog.BrowserDialog)23 Button (android.widget.Button)22 Activity (android.app.Activity)18