Skip to content

Commit

Permalink
dialog bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed Apr 18, 2017
1 parent 73709e5 commit f9572ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

//分层 合成聚合原则
httpMaster = new HttpMaster(this, this,this);
dialogMaster = new DialogMaster(this,this);
dialogMaster = new DialogMaster(this);
navigateMaster = new NavigateMaster(this);

TLog.i(TAG, "onCreate: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,

//分层 合成聚合原则
httpMaster = new HttpMaster(mContext, this,this);
dialogMaster = new DialogMaster(mContext,this);
dialogMaster = new DialogMaster(mContext);
navigateMaster = new NavigateMaster(mContext);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,64 +16,37 @@
public class DialogMaster implements ProgressView {
private Context mContext;
private MaterialDialogFactory materialDialogFactory;
private String customProgressMsg ; //定制进度提示信息,不同场景要求可能不一样。
private ProgressView progressView;
private String customProgressMsg; //定制进度提示信息,不同场景要求可能不一样。

public DialogMaster(Context mContext) {
this.mContext = mContext;
materialDialogFactory = MaterialDialogFactory.getInstance(mContext);
customProgressMsg = ResourceUtil.getString(mContext,R.string.loading);
}

public DialogMaster(Context mContext, ProgressView progressView) {
this.mContext = mContext;
this.progressView = progressView;
customProgressMsg = ResourceUtil.getString(mContext,R.string.loading);
customProgressMsg = ResourceUtil.getString(mContext, R.string.loading);
}

@Override
public void onShowProgressDialog() {
if(progressView != null){
progressView.onShowProgressDialog();
}else{
materialDialogFactory.createMsgProgressMaterialDialog(customProgressMsg);
}
materialDialogFactory.createMsgProgressMaterialDialog(customProgressMsg);
}

@Override
public void onHideProgressDialog() {
if(progressView != null){
progressView.onHideProgressDialog();
}else{
materialDialogFactory.hideProgressMaterialDialog();
}
materialDialogFactory.hideProgressMaterialDialog();
}

@Override
public void onShowMessageDiaolg(@NonNull String msg) {
if(progressView != null){
progressView.onShowMessageDiaolg(msg);
}else{
materialDialogFactory.createMsgProgressMaterialDialog(msg);
}
materialDialogFactory.createMsgProgressMaterialDialog(msg);
}

@Override
public void customProgressMsg(int msgRes) {
if(progressView != null){
progressView.customProgressMsg(msgRes);
}else{
customProgressMsg = ResourceUtil.getString(msgRes);
}
customProgressMsg = ResourceUtil.getString(msgRes);
}

@Override
public void customProgressMsg(String msg) {
if(progressView != null){
progressView.customProgressMsg(msg);
}else{
customProgressMsg = msg;
}
customProgressMsg = msg;
}

@Override
Expand Down

0 comments on commit f9572ef

Please sign in to comment.