Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Activity To Show Loading #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}
}

Expand Down