package com.rehome.meetingbook.weiget;

import android.content.Context;
import android.view.Display;
import android.view.Window;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;

/**
 * Create By HuangWenFei
 * 创建日期：2022-12-10 11:28
 * 描述：
 */
public class CbsMemberAlertDialog  extends AlertDialog {
    public CbsMemberAlertDialog(@NonNull Context context) {
        super(context);
        Window window = getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.width = (getScreenWidth(context))  / 4;
    }


    //获取屏幕宽度
    public static int getScreenWidth(Context context) {
        WindowManager manager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        Display display = manager.getDefaultDisplay();
        return display.getWidth();
    }
}
