Search in sources :

Example 91 with Dialog

use of android.app.Dialog in project JieCaoVideoPlayer by lipangit.

the class JCVideoPlayerStandardFresco method showVolumeDialog.

@Override
public void showVolumeDialog(float deltaY, int volumePercent) {
    super.showVolumeDialog(deltaY, volumePercent);
    if (mVolumeDialog == null) {
        View localView = LayoutInflater.from(getContext()).inflate(R.layout.jc_dialog_volume, null);
        mDialogVolumeProgressBar = ((ProgressBar) localView.findViewById(R.id.volume_progressbar));
        mVolumeDialog = new Dialog(getContext(), R.style.jc_style_dialog_progress);
        mVolumeDialog.setContentView(localView);
        mVolumeDialog.getWindow().addFlags(8);
        mVolumeDialog.getWindow().addFlags(32);
        mVolumeDialog.getWindow().addFlags(16);
        mVolumeDialog.getWindow().setLayout(-2, -2);
        WindowManager.LayoutParams localLayoutParams = mVolumeDialog.getWindow().getAttributes();
        localLayoutParams.gravity = Gravity.CENTER;
        mVolumeDialog.getWindow().setAttributes(localLayoutParams);
    }
    if (!mVolumeDialog.isShowing()) {
        mVolumeDialog.show();
    }
    mDialogVolumeProgressBar.setProgress(volumePercent);
}
Also used : Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) ProgressBar(android.widget.ProgressBar) WindowManager(android.view.WindowManager)

Example 92 with Dialog

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();
}
Also used : AlertDialog(android.app.AlertDialog) Dialog(android.app.Dialog)

Example 93 with Dialog

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();
}
Also used : AlertDialog(android.app.AlertDialog) Dialog(android.app.Dialog)

Example 94 with Dialog

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();
}
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 95 with Dialog

use of android.app.Dialog in project platform_frameworks_base by android.

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(mLayoutResId, null);
    View titleView = childPrefScreen.findViewById(android.R.id.title);
    mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
    if (mDividerSpecified) {
        mListView.setDivider(mDividerDrawable);
    }
    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)) {
        if (titleView != null) {
            titleView.setVisibility(View.GONE);
        }
        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    } else {
        if (titleView instanceof TextView) {
            ((TextView) titleView).setText(title);
            titleView.setVisibility(View.VISIBLE);
        } 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) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

Dialog (android.app.Dialog)792 View (android.view.View)317 AlertDialog (android.app.AlertDialog)256 TextView (android.widget.TextView)219 DialogInterface (android.content.DialogInterface)200 Intent (android.content.Intent)97 Bundle (android.os.Bundle)94 Context (android.content.Context)93 AlertDialog (android.support.v7.app.AlertDialog)93 ListView (android.widget.ListView)87 EditText (android.widget.EditText)84 Button (android.widget.Button)80 AdapterView (android.widget.AdapterView)79 NonNull (android.support.annotation.NonNull)77 LayoutInflater (android.view.LayoutInflater)75 ImageView (android.widget.ImageView)70 ArrayList (java.util.ArrayList)64 LinearLayout (android.widget.LinearLayout)54 WindowManager (android.view.WindowManager)52 ProgressDialog (android.app.ProgressDialog)51