android.app.ProgressDialog#setContentView ( )源码实例Demo

下面列出了android.app.ProgressDialog#setContentView ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: weMessage   文件: LaunchFragment.java
private void showProgressDialog(final View view, String title, String message){
    final ProgressDialog progressDialog = new ProgressDialog(getActivity());
    ProgressDialogLayout progressDialogLayout = (ProgressDialogLayout) getActivity().getLayoutInflater().inflate(R.layout.progress_dialog_layout, null);

    progressDialog.setCancelable(false);

    progressDialogLayout.setTitle(title);
    progressDialogLayout.setMessage(message);
    progressDialogLayout.setButton(getString(R.string.word_cancel), new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            serviceConnection.scheduleTask(new Runnable() {
                @Override
                public void run() {
                    serviceConnection.getConnectionService().endService();
                }
            });
            progressDialog.dismiss();
            generateInvalidSnackBar(view, getString(R.string.connection_cancelled)).show();
            loginProgressDialog = null;
        }
    });
    progressDialog.show();
    progressDialog.setContentView(progressDialogLayout);
    loginProgressDialog = progressDialog;
}
 
源代码2 项目: BigApp_Discuz_Android   文件: LoadingDialog.java
public static ProgressDialog createProgressDialog(Context context,
		String text) {
	final ProgressDialog dlg = new ProgressDialog(context, R.style.Theme_Dialog_Default);

	dlg.show();
	dlg.setContentView(R.layout.loading_layout);
	LinearLayout root = (LinearLayout) dlg
			.findViewById(R.id.progressDialog);
	root.setGravity(android.view.Gravity.CENTER);
	root.getBackground().setAlpha(100);// 0~255透明度值 ,0为完全透明,255为不透明
	LoadingView mLoadView = new LoadingView(context);
	mLoadView.setDrawableResId(R.drawable.loading_img);
	root.addView(mLoadView);
	TextView alert = new TextView(context);
	alert.setGravity(android.view.Gravity.CENTER);
	alert.setHeight(50);
	alert.setText(text);
	alert.setTextColor(0xFFFFFFFF);
	root.addView(alert);
	dlg.setCanceledOnTouchOutside(false);
	return dlg;
}
 
源代码3 项目: InstantAppStarter   文件: CommonUtils.java
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;
}
 
源代码4 项目: Android-Example   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
      ProgressDialog dialog;
      dialog = ProgressDialog.show(MainActivity.this,null,null);
      dialog.setContentView(R.layout.progressbar);
      dialog.show();

}
 
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;
}
 
源代码6 项目: android-mvvm-architecture   文件: CommonUtils.java
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;
}
 
源代码7 项目: android-mvp-architecture   文件: CommonUtils.java
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;
}
 
源代码8 项目: EosCommander   文件: UiUtils.java
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;
}
 
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;
}
 
源代码10 项目: ello-android   文件: MainActivity.java
private ProgressDialog createProgressDialog(Context mContext) {
    ProgressDialog dialog = new ProgressDialog(mContext);
    try {
        dialog.show();
    } catch (WindowManager.BadTokenException e) {}
    dialog.setCancelable(false);
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    dialog.setContentView(R.layout.progress_dialog);
    return dialog;
}
 
源代码11 项目: BigApp_Discuz_Android   文件: LoadingDialog.java
public LoadingDialog(Context context, String text) {
	this.context = context;
	this.handler = new MyHandler();
	dlg = new ProgressDialog(context, R.style.Theme_Dialog_Default);

	dlg.show();
	dlg.setContentView(R.layout.loading_layout);
	LinearLayout root = (LinearLayout) dlg
			.findViewById(R.id.progressDialog);
	root.setGravity(android.view.Gravity.CENTER);
	root.getBackground().setAlpha(100);// 0~255透明度值 ,0为完全透明,255为不透明
	mLoadView = new LoadingView(context);
	mLoadView.setDrawableResId(R.drawable.loading_img);
	root.addView(mLoadView);

	imgView = new ImageView(context);
	imgView.setImageResource(R.drawable.loading_img);
	root.addView(imgView);
	imgView.setVisibility(View.GONE);

	alert = new TextView(context);
	alert.setGravity(android.view.Gravity.CENTER);
	alert.setHeight(50);
	alert.setText(text);
	alert.setTextColor(0xFFFFFFFF);
	root.addView(alert);
	dlg.setCanceledOnTouchOutside(false);

}
 
源代码12 项目: BigApp_Discuz_Android   文件: LoadingDialog.java
public LoadingDialog(Context context, int resLayoutId, int resImgId,
		String text, boolean isCanceledOnTouchOutside) {
	this.context = context;
	this.handler = new MyHandler();

	dlg = new ProgressDialog(context, R.style.Theme_Dialog_Default);

	dlg.show();
	dlg.setContentView(resLayoutId);
	LinearLayout root = (LinearLayout) dlg
			.findViewById(R.id.progressDialog);
	root.setGravity(android.view.Gravity.CENTER);
	root.getBackground().setAlpha(100);// 0~255透明度值 ,0为完全透明,255为不透明
	mLoadView = new LoadingView(context);
	mLoadView.setDrawableResId(resImgId);
	root.addView(mLoadView);

	imgView = new ImageView(context);
	imgView.setImageResource(R.drawable.loading_img);
	root.addView(imgView);
	imgView.setVisibility(View.GONE);

	alert = new TextView(context);
	alert.setGravity(android.view.Gravity.CENTER);
	alert.setHeight(50);
	alert.setText(text);
	alert.setTextColor(0xFFFFFFFF);
	root.addView(alert);
	dlg.setCanceledOnTouchOutside(isCanceledOnTouchOutside);

}
 
源代码13 项目: Mupdf   文件: ProofActivity.java
private static ProgressDialog createAndShowWaitSpinner(Context mContext)
{
	ProgressDialog dialog = new ProgressDialog(mContext);
	try {
		dialog.show();
	}
	catch (WindowManager.BadTokenException e) {
	}
	dialog.setCancelable(false);
	dialog.setIndeterminate(true);
	dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
	dialog.setContentView(R.layout.wait_spinner);
	return dialog;
}