Search in sources :

Example 46 with Dialog

use of android.app.Dialog in project GSYVideoPlayer by CarGuo.

the class StandardGSYVideoPlayer method showVolumeDialog.

@Override
protected void showVolumeDialog(float deltaY, int volumePercent) {
    super.showVolumeDialog(deltaY, volumePercent);
    if (mVolumeDialog == null) {
        View localView = LayoutInflater.from(getContext()).inflate(R.layout.video_volume_dialog, null);
        mDialogVolumeProgressBar = ((ProgressBar) localView.findViewById(R.id.volume_progressbar));
        if (mVolumeProgressDrawable != null) {
            mDialogVolumeProgressBar.setProgressDrawable(mVolumeProgressDrawable);
        }
        mVolumeDialog = new Dialog(getContext(), R.style.video_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.TOP | Gravity.LEFT;
        localLayoutParams.width = getWidth();
        localLayoutParams.height = getHeight();
        int[] location = new int[2];
        getLocationOnScreen(location);
        localLayoutParams.x = location[0];
        localLayoutParams.y = location[1];
        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) ENDownloadView(moe.codeest.enviews.ENDownloadView) ENPlayView(moe.codeest.enviews.ENPlayView) View(android.view.View) TextView(android.widget.TextView) ProgressBar(android.widget.ProgressBar) WindowManager(android.view.WindowManager)

Example 47 with Dialog

use of android.app.Dialog in project GSYVideoPlayer by CarGuo.

the class StandardGSYVideoPlayer method showProgressDialog.

@Override
protected void showProgressDialog(float deltaX, String seekTime, int seekTimePosition, String totalTime, int totalTimeDuration) {
    super.showProgressDialog(deltaX, seekTime, seekTimePosition, totalTime, totalTimeDuration);
    if (mProgressDialog == null) {
        View localView = LayoutInflater.from(getContext()).inflate(R.layout.video_progress_dialog, null);
        mDialogProgressBar = ((ProgressBar) localView.findViewById(R.id.duration_progressbar));
        if (mDialogProgressBarDrawable != null) {
            mDialogProgressBar.setProgressDrawable(mDialogProgressBarDrawable);
        }
        mDialogSeekTime = ((TextView) localView.findViewById(R.id.tv_current));
        mDialogTotalTime = ((TextView) localView.findViewById(R.id.tv_duration));
        mDialogIcon = ((ImageView) localView.findViewById(R.id.duration_image_tip));
        mProgressDialog = new Dialog(getContext(), R.style.video_style_dialog_progress);
        mProgressDialog.setContentView(localView);
        mProgressDialog.getWindow().addFlags(Window.FEATURE_ACTION_BAR);
        mProgressDialog.getWindow().addFlags(32);
        mProgressDialog.getWindow().addFlags(16);
        mProgressDialog.getWindow().setLayout(getWidth(), getHeight());
        if (mDialogProgressNormalColor != -11) {
            mDialogTotalTime.setTextColor(mDialogProgressNormalColor);
        }
        if (mDialogProgressHighLightColor != -11) {
            mDialogSeekTime.setTextColor(mDialogProgressHighLightColor);
        }
        WindowManager.LayoutParams localLayoutParams = mProgressDialog.getWindow().getAttributes();
        localLayoutParams.gravity = Gravity.TOP;
        localLayoutParams.width = getWidth();
        localLayoutParams.height = getHeight();
        int[] location = new int[2];
        getLocationOnScreen(location);
        localLayoutParams.x = location[0];
        localLayoutParams.y = location[1];
        mProgressDialog.getWindow().setAttributes(localLayoutParams);
    }
    if (!mProgressDialog.isShowing()) {
        mProgressDialog.show();
    }
    mDialogSeekTime.setText(seekTime);
    mDialogTotalTime.setText(" / " + totalTime);
    if (totalTimeDuration > 0)
        mDialogProgressBar.setProgress(seekTimePosition * 100 / totalTimeDuration);
    if (deltaX > 0) {
        mDialogIcon.setBackgroundResource(R.drawable.video_forward_icon);
    } else {
        mDialogIcon.setBackgroundResource(R.drawable.video_backward_icon);
    }
}
Also used : Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) ENDownloadView(moe.codeest.enviews.ENDownloadView) ENPlayView(moe.codeest.enviews.ENPlayView) View(android.view.View) TextView(android.widget.TextView) ProgressBar(android.widget.ProgressBar) WindowManager(android.view.WindowManager)

Example 48 with Dialog

use of android.app.Dialog in project AndroidChromium by JackyAndroid.

the class CertificateViewer method showDialogForView.

// Displays a dialog with scrolling for the given view.
private void showDialogForView(View view) {
    Dialog dialog = new Dialog(mContext);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.addContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
    dialog.show();
}
Also used : Dialog(android.app.Dialog) LinearLayout(android.widget.LinearLayout)

Example 49 with Dialog

use of android.app.Dialog in project AndroidChromium by JackyAndroid.

the class ItemChooserDialog method showDialogForView.

private void showDialogForView(View view) {
    mDialog = new Dialog(mActivity) {

        @Override
        public void onWindowFocusChanged(boolean hasFocus) {
            super.onWindowFocusChanged(hasFocus);
            if (!hasFocus)
                super.dismiss();
        }
    };
    mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mDialog.setCanceledOnTouchOutside(true);
    mDialog.addContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
    mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            mItemSelectedCallback.onItemSelected("");
        }
    });
    Window window = mDialog.getWindow();
    if (!DeviceFormFactor.isTablet(mActivity)) {
        // On smaller screens, make the dialog fill the width of the screen,
        // and appear at the top.
        window.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
        window.setGravity(Gravity.TOP);
        window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    }
    mDialog.show();
}
Also used : Window(android.view.Window) ColorDrawable(android.graphics.drawable.ColorDrawable) DialogInterface(android.content.DialogInterface) Dialog(android.app.Dialog) LinearLayout(android.widget.LinearLayout)

Example 50 with Dialog

use of android.app.Dialog in project AndroidChromium by JackyAndroid.

the class RepostFormWarningDialog method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme).setMessage(R.string.http_post_warning);
    if (savedInstanceState == null) {
        assert mTab != null;
        builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int id) {
                if (!mTab.isInitialized())
                    return;
                mTab.getWebContents().getNavigationController().cancelPendingReload();
            }
        });
        builder.setPositiveButton(R.string.http_post_warning_resend, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int id) {
                if (!mTab.isInitialized())
                    return;
                mTab.getWebContents().getNavigationController().continuePendingReload();
            }
        });
    }
    Dialog dialog = builder.create();
    setCurrentDialogForTesting(dialog);
    return dialog;
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface) AlertDialog(android.support.v7.app.AlertDialog) Dialog(android.app.Dialog) SuppressLint(android.annotation.SuppressLint)

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