package com.tofly.ghrq_route.common.util;

import android.view.View;

import com.google.android.material.snackbar.Snackbar;

public class SnackBarUtil {

    public static void showSnack(View rootView, String errMsg) {
        Snackbar snackbar = Snackbar.make(rootView, errMsg, Snackbar.LENGTH_SHORT);
        snackbar.show();
    }

    public static void showSnackAlways(View rootView, String errMsg) {
        Snackbar snackbar = Snackbar.make(rootView, errMsg, Snackbar.LENGTH_INDEFINITE);
        snackbar.show();
    }

    public static void showSnackAlways(View rootView, String errMsg, String errAction, View.OnClickListener listener) {
        Snackbar snackbar = Snackbar.make(rootView, errMsg, Snackbar.LENGTH_INDEFINITE);
        snackbar.setAction(errAction, listener);
        snackbar.show();
    }
}
