Java Code Examples for android.app.progressdialog#getWindow()

The following examples show how to use android.app.progressdialog#getWindow() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BloggerActivity.java    From LLApp with Apache License 2.0 6 votes vote down vote up
private void initPressDialog() {
        dialog = new ProgressDialog(this);
// 设置mProgressDialog风格
        dialog.setProgress(ProgressDialog.STYLE_SPINNER);//圆形
// 设置mProgressDialog标题
        dialog.setMessage("加载中,请稍后...");
        Window window = dialog.getWindow();
        //设置背景透明度
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.alpha = 1.0f;
        lp.dimAmount = 1.0f;// 黑暗度
        window.setAttributes(lp);
// 设置mProgressDialog提示
//        mProgressDialog.setMessage("这是一个圆形进度条对话框");
// 设置mProgressDialog进度条的图标
//        mProgressDialog.setIcon(R.mipmap.ic);
// 设置mProgressDialog的进度条是否不明确
//不滚动时,当前值在最小和最大值之间移动,一般在进行一些无法确定操作时间的任务时作为提示,明确时就是根据你的进度可以设置现在的进度值
//        mProgressDialog.setIndeterminate(false);
//    mProgressDialog.setProgress(m_count++);
// 是否可以按回退键取消
        dialog.setCancelable(true);
        dialog.show();

    }
 
Example 2
Source File: CommonUtils.java    From InstantAppStarter with MIT License 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}
 
Example 3
Source File: CommonUtils.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}
 
Example 4
Source File: CommonUtils.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}
 
Example 5
Source File: CommonUtils.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}
 
Example 6
Source File: UiUtils.java    From EosCommander with MIT License 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(false);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}
 
Example 7
Source File: DialogUtils.java    From Android-MVP-Sample-Application with Apache License 2.0 5 votes vote down vote up
public static ProgressDialog showLoadingDialog(Context context) {
    ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.show();
    if (progressDialog.getWindow() != null) {
        progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    progressDialog.setContentView(R.layout.progress_dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setCanceledOnTouchOutside(false);
    return progressDialog;
}