package com.project.ilsaenterprise;

import android.app.Activity;
import android.app.AlertDialog;
import android.view.LayoutInflater;

public class LoadingProgress {

    Activity activity;
    AlertDialog dialog;

    LoadingProgress(Activity loginActivity){
        activity = loginActivity;
    }

    void startLoadingDialog(){
        if(activity != null){
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);

            LayoutInflater inflater = activity.getLayoutInflater();
            builder.setView(inflater.inflate(R.layout.dialog_loading, null));
            builder.setCancelable(false);

            dialog = builder.create();
            dialog.show();
        }
    }

    void dismissDialog(){
        if(activity != null){
            dialog.dismiss();
        }
    }
}
