package com.makeeasy.dailyinterest;

import android.app.ProgressDialog;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Constant {

    public static ProgressDialog dialog;
    public static final String ARRAY_NAME = "Friendvilla";
    public static final String HOST_NAME = "https://dailyinterest.in/admin/";

    public static boolean isConnected(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        assert cm != null;
        NetworkInfo info = cm.getActiveNetworkInfo();
        return (info != null && info.isConnected());
    }

    public static void showLoader(Context ctx,String msg) {
        dialog = new ProgressDialog(ctx);
        dialog.setCancelable(false);
        if(msg.equals("")) {
            dialog.setMessage("Please wait...");
        } else {
            dialog.setMessage(msg);
        }
        dialog.show();
    }

    public static void hideLoader() {
        if(dialog != null) {
            dialog.dismiss();
        }
    }
}
