package it.integry.integrywmsnative.core.utility;

import android.app.Dialog;
import android.content.Context;
import android.widget.LinearLayout;

import androidx.fragment.app.DialogFragment;

public class UtilityDialog {



    public static void setTo60PercentWidth(Context context, DialogFragment dialog) {
        int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.60);

        dialog.getDialog().getWindow().setLayout(width, LinearLayout.LayoutParams.MATCH_PARENT);
    }

    public static void setTo90PercentWidth(Context context, Dialog dialog) {
        int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.90);

        dialog.getWindow().setLayout(width, LinearLayout.LayoutParams.WRAP_CONTENT);
    }

    public static void setTo90PercentWidth(Context context, DialogFragment dialog) {
        int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.90);

        dialog.getDialog().getWindow().setLayout(width, LinearLayout.LayoutParams.WRAP_CONTENT);
    }

    public static void setTo95PercentWidth(Context context, DialogFragment dialog) {
        int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.95);

        dialog.getDialog().getWindow().setLayout(width, LinearLayout.LayoutParams.WRAP_CONTENT);
    }

//    public static void setTo90PercentHeight(Context context, Dialog dialog) {
//        int height = (int)(context.getResources().getDisplayMetrics().heightPixels*0.90);
//
//        dialog.getWindow().setLayout(width, LinearLayout.LayoutParams.WRAP_CONTENT);
//    }

}
