public static CustomProgressDialog createDialog(Context context) { final int CustomProgressDialog = RefResourceUtil.getStyleId(context, "CustomProgressDialog"); final int progress_dialog_loading = RefResourceUtil.getLayoutId(context, "progress_dialog_loading"); customProgressDialog = new CustomProgressDialog(context, CustomProgressDialog); customProgressDialog.setContentView(progress_dialog_loading); customProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER; return customProgressDialog; }
public void setMessage(CharSequence message) { if (this.context == null) { return; } final int tvMessageId = RefResourceUtil.getId(this.context, "progress_tv_message"); TextView tvMsg = (TextView) customProgressDialog.findViewById(tvMessageId); if (tvMsg != null) { tvMsg.setText(message); } }