package cn.tee3.manager.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

public class MyToast {

    public static void showToast(Context context, String log, boolean isLongTime) {
        Toast.makeText(context, log, isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
    }

    public static void showToast(Context context, String log, boolean isLongTime, boolean isAlignBottom) {
        Toast toast = Toast.makeText(context, log, isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
        if (!isAlignBottom) {
            toast.setGravity(Gravity.CENTER, 0, 0);
        }
        toast.show();
    }

    public static void showToast(Context context, String log) {
        Toast toast = Toast.makeText(context, log, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.BOTTOM, 0, 500);
        toast.show();
    }

    public static void showToast(Context context, String log, int yOffset) {
        Toast toast = Toast.makeText(context, log, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.BOTTOM, 0, yOffset);
        toast.show();
    }

}
