From 1f1b57a17a45d90ca59c5bb6fa32506c33e69570 Mon Sep 17 00:00:00 2001 From: monotonique Date: Sun, 22 Oct 2017 14:50:16 +0800 Subject: [PATCH] Call Activity To Show Loading when showing the loading dialog, directly call the base activity to do the same job --- .../mindorks/framework/mvp/ui/base/BaseFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java b/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java index 70f0811..a6d2c41 100644 --- a/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java +++ b/app/src/main/java/com/mindorks/framework/mvp/ui/base/BaseFragment.java @@ -36,7 +36,6 @@ public abstract class BaseFragment extends Fragment implements MvpView { private BaseActivity mActivity; private Unbinder mUnBinder; - private ProgressDialog mProgressDialog; @Override public void onCreate(@Nullable Bundle savedInstanceState) { @@ -62,14 +61,15 @@ public void onAttach(Context context) { @Override public void showLoading() { - hideLoading(); - mProgressDialog = CommonUtils.showLoadingDialog(this.getContext()); + if (mActivity != null) { + mActivity.showLoading(); + } } @Override public void hideLoading() { - if (mProgressDialog != null && mProgressDialog.isShowing()) { - mProgressDialog.cancel(); + if (mActivity != null) { + mActivity.hideLoading(); } }